Systems and methods for generating error correction information for a media stream

ABSTRACT

The present invention is related to video encoding. In an embodiment, a first instruction stored in processor readable memory is configured to generate forward error correction data for selected portions of packet data from a plurality of frame packets. A second instruction stored in processor readable memory is configured to store the forward error correction data in a first packet separate from the plurality of frame packets. A third instruction stored in processor readable memory is configured to identify the first packet with a user data identifier code. The separate packet is optionally compliant with MPEG-4.

PRIORITY CLAIM

[0001] This application claims the benefit under 35 U.S.C. 119(e) ofU.S. Provisional Application No. 60/273,443, filed Mar. 5, 2001, U.S.Provisional Application No. 60/275,859, filed Mar. 14, 2001, and U.S.Provisional Application No. 60/286,280, filed Apr. 25, 2001, which areincorporated herein in their entirety.

APPENDIX A

[0002] Appendix A, which forms a part of this disclosure, is a list ofcommonly owned copending U.S. patent applications. Each of theapplications listed in Appendix A is hereby incorporated by referenceherein in its entirety.

COPYRIGHT RIGHTS

[0003] A portion of the disclosure of this patent document containsmaterial that is subject to copyright protection. The copyright ownerhas no objection to the facsimile reproduction by any one of the patentdocument or the patent disclosure, as it appears in the Patent andTrademark Office patent file or records, but otherwise reserves allcopyright rights whatsoever.

BACKGROUND OF THE INVENTION

[0004] 1. Field of the Invention

[0005] The present invention is related to video and image coding and inparticular to systems and methods for coding video image information ina compressed and error resilient manner.

[0006] 2. Description of the Related Art

[0007] MPEG is an ISO/IEC standard developed by MPEG (Moving PictureExperts Group). There are several versions of the MPEG standard, such asMPEG-1, MPEG-2, MPEG-4, and MPEG-7, and they are intended to standardizecertain aspects of image and audio compression. As with other forms ofvideo compression, such as H.261, H.262, H.263, H.263+, H.263++, H.26L,MPEG compression attempts to eliminate redundant or irrelevant data. Forexample, an MPEG encoder uses information from selected frames to reducethe overall video data that needs to be transmitted for certain otherframes.

[0008] Typically, a video frame can be encoded in one of three ways, asan intraframe, as a predicted frame, and as a bi-directional frame. Inaddition, a video frame can also be skipped in order to reduce theresulting file size or bit-rate. An intraframe typically contains thecomplete image data for that frame and so does not rely on image datafrom other frames. Intraframe encoding provides the least compression. Apredicted frame generally contains just enough information to allow adecoder to display the frame based on a recent preceding intraframe orpredicted frame. This means that the predicted frame contains the datathat relates to how the image has changed from the previous frame andresidual error correction data. A bi-directional frame is generated frominformation from the surrounding intraframe(s) and/or predicted frames,including residual error correction data. Using data from thesurrounding frames, the decoder uses interpolation to calculate theposition and color of each pixel.

[0009] The MPEG-4 standard was developed for use with both low and highbit rate applications. For example, MPEG-4 has been enhanced for use ininteractive video games, videoconferencing, videophones, interactivestorage media, multimedia mailing, wireless multimedia and broadcastingapplications. MPEG-4 provides for object scalability, improved errorrobustness and enhanced compression.

[0010] The ever-increasing demand for multimedia communications via thewired/wireless Internet faces the challenge of packet loss as well asbandwidth fluctuation. The dependency between image frames makes thecompressed video stream vulnerable even to a small number of lostpackets. MPEG-4 has therefore been particularly enhanced for use in lowbit rate (<64 kbs), error prone applications, such as mobile, wirelessapplications, and error-prone ATM (asynchronous transfer mode) networkapplications. Mobile operation tends to be more susceptible totransmission errors as there is often less data redundancy, in order toreduce bit rates, and greater sources of “noise.” For example, wirelesschannels can be corrupted by environmental noise, and in the case ofmobile applications, by burst noise resulting from multipath fading andshadowing caused by buildings and other structures. With respect to ATMnetwork applications, cells can be lost due to network congestion andbuffer overflow.

[0011] MPEG-4 has enhanced error resiliency as compared to previousversions of MPEG so that video data can be more successfully transmittedover such error prone networks. For example, one error resiliencytechnique provided for by the MPEG-4 standard is the use of resyncmarkers in the video bit-stream. In particular, MPEG-4 has adopted fixedinterval synchronization and specifies that video object plane (VOP)start codes and resynchronization markers (i.e., the start of a videopacket) appear only at legal fixed interval locations in the bitstream.This helps to avoid the problems associated with start codes emulations.Through the use of resync markers included by an encoder in the videodata, synchronization lost after an error can be regained by a decoder.

[0012] Another error resiliency technique provided for by the MPEG-4standard is the use of a reversible variable-length code. This code canbe decoded even when read backwards, enabling a decoder to useuncorrupted information from a newly found resync marker back to thepoint in the data where the error occurred. Still another errorresiliency technique adopted by MPEG-4 is data partitioning, used toseparate motion information from texture information using a secondresynchronization marker inserted between motion and textureinformation. Thus, if there is an error and the texture information isundecodable or lost, the decoder can utilize the motion information toconceal the error by using the motion information to compensate theprevious decoded frame or VOP.

[0013] However, despite the use of the enhancements described above,many MPEG-4 encoders and decoders fail to provide sufficient errorresiliency as is often desired in error-prone applications, such as incellular phone applications. Thus, the transmission of MPEG-4 compliantvideo streams over cellular networks often results in unrecoverablecorrupted data and the significant degradation in the quality of thevideo data seen by a recipient. Such video degradation can make videocommunication over error-prone networks undesirable for a user'sperspective, and disadvantageously impedes the adoption and use of videotransmissions over error-prone networks.

[0014] Further, to meet target bit rates, conventional encoders dropframes to reduce the frame rate according to a simple skippingalgorithm. For example, a conventional encoder will drop every 4 of 5frames in a video clip to convert the video clip from a 30 frames persecond rate to a 6 frames per second rate. However, this simple form ofskipping often has a significant adverse impact on the visual qualitywhen decoded.

SUMMARY OF THE INVENTION

[0015] The present invention is related to video encoding and inparticular to systems and methods for encoding video information fortransmission in a compressed manner and/or an error resilient manner.Embodiments of the present invention advantageously enable thetransmission of video information even in low-bit rate, high noiseenvironments. For example, embodiments of the present invention enablevideo transmission to be successfully performed over cellular networksand the like.

[0016] In one embodiment, error resiliency is enhanced using forwarderror correction (FEC) information. FEC coding is efficiently andselectively applied in real-time to important data, such as motionvectors, DC coefficients and header information, rather then generatingFEC bits for unimportant or less important data. This selected importantdata may be located in a packet between a packet resync field and amotion marker. In particular, for a given frame or VOP, the selectedpacket bits targeted for FEC coding are concatenated together and theFEC code bits are generated for the concatenated bits. Optionally, theresulting FEC bits are placed in an additional packet after the regularframe or VOP packets to ensure MPEG compatibility.

[0017] One embodiment of the present invention is a method of providingforward error correction (FEC) on a plurality of frame packets, themethod comprising: concatenating selected portions of packet datacorresponding to a plurality of frame packets for a first frame;generating forward error correction bits for the concatenated selectedportions of packet data; and transmitting the forward error correctionbits in a separate packet identified with a user data identifier code orthe like, including other unique identifier codes to be assigned in thefuture by MPEG-standards committee and the like.

[0018] Another embodiment of the present invention is an errorcorrection generation circuit, comprising: a first instruction stored inprocessor readable memory configured to generate forward errorcorrection data for selected portions of packet data that are to betransmitted in a corresponding plurality of frame packets; a secondinstruction stored in processor readable memory configured to store theforward error correction data in a first packet separate from theplurality of frame packets; and a third instruction stored in processorreadable memory configured to identify the first packet with a firstdata identifier code.

[0019] Still another embodiment of the present invention is an encodercircuit, comprising: a means for generating forward error correctiondata for selected portions of packet data from a plurality of framepackets; a means for storing the forward error correction data in afirst packet separate from the plurality of frame packets; and a meansfor identifying the first packet with a first data identifier code.

[0020] Further, embodiments of the present invention provide for using aHeader Extension Code (HEC) in a sequence of video packets or in everyvideo packet, and not just on the first video packet following the VOPheader as with conventional encoders. This better ensures that even if apacket is lost or corrupted, subsequent packets can still be decoded andused. Further, even many conventional decoders will be able to handlethe inclusion of the enhanced use of HECs.

[0021] Optionally, a Video-Object-Layer (VOL) header has a flag setindicating that a fixed Video Object Plane (VOP) increment is to beused, followed by the fixed time increment value. This will facilitatethe decoder's detection of missing frames, that is, frames eitherskipped by the encoder in order to achieve higher compression or lostduring transmission.

BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Embodiments of the present invention will now be described withreference to the drawings summarized below. These drawings and theassociated description are provided to illustrate example embodiments ofthe invention, and not to limit the scope of the invention.

[0023]FIG. 1A illustrates an example networked system for implementing avideo distribution system.

[0024] FIGS. 1B-C illustrate an example encoder architecture inaccordance with an embodiment of the present invention.

[0025] FIGS. 2A-B illustrate an example refresh map and an example scanorder that can be used with an embodiment of the present invention.

[0026]FIG. 3 illustrates an example analysis of a video sequence used tolocate a scene change.

[0027] FIGS. 4A-4B illustrate an example of adaptive frame skipping inaccordance with an embodiment of the present invention.

[0028]FIG. 5 illustrates an example use of second order motioncompensation.

[0029]FIG. 6 illustrates an example packetized bitstream.

[0030]FIG. 7 illustrates an example use of consecutive I-frames inaccordance with an embodiment of the present invention

[0031] FIGS. 8A-H illustrate example processes for adaptive intrarefresh.

[0032]FIG. 9 illustrates an example rate control process in accordancewith an embodiment of the present invention.

[0033]FIG. 10 illustrates an example scene level recursive bitallocation process.

[0034]FIG. 11 illustrates an example graph of Forward Error Correctionoverhead vs. average BER correction capability.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

[0035] The present invention is related to video encoding and inparticular to systems and methods for encoding video information fortransmission in a compressed and/or an error resilient manner. Thus,embodiments of the present invention advantageously enable thetransmission of video information even in low-bit rate, noise,error-prone environments. Embodiments of the present invention can beused with a variety of video compression standards, such as, by way ofexample, the MPEG-4 standard, as well as MPEG-1, MPEG-2, H.261, H.262,H.263, H.263+, H.263++, and H.26L, and video standards yet to bedeveloped. Aspects of the MPEG-4 standard are defined in “Coding ofAudio-Visual Objects: Systems,” 14496-1, ISO/IEC JTC1/SC29/WG11 N2501,November 1998, and “Coding of Audio-Visual Objects: Visual,” 14496-2,ISO/IEC JTC1/SC29/WG11 N2502, November 1998, and the MPEG-4 VideoVerification Model is defined in “MPEG-4 Video Verification Model 17.0”,ISO/IEC JTC1/SC29/WG11 N3515, Beijing, China, July 2000, which areincorporated herein by reference in their entirety.

[0036]FIG. 1A illustrates a networked system for implementing a videodistribution system in accordance with one embodiment of the invention.An encoding computer 102 receives a video signal, which is to be encodedto a relatively compact and robust format. The encoding computer 102 cancorrespond to a variety of machine types, including general purposecomputers that execute software and to specialized hardware. Theencoding computer 102 can receive a video sequence from a wide varietyof sources, such as via a satellite receiver 104, a video camera 106,and a video conferencing terminal 108. The video camera 106 cancorrespond to a variety of camera types, such as video camera recorders,Web cams, cameras built into wireless devices, and the like. Videosequences can also be stored in a data store 110. The data store 110 canbe internal to or external to the encoding computer 102. The data store110 can include devices such as tapes, hard disks, optical disks, andthe like. It will be understood by one of ordinary skill in the art thata data store, such as the data store 110 illustrated in FIG. 1A, canstore unencoded video, encoded video, or both. In one embodiment, theencoding computer 102 retrieves unencoded video from a data store, suchas the data store 110, encodes the unencoded video, and stores theencoded video to a data store, which can be the same data store oranother data store. It will be understood that a source for the videocan include a source that was originally taken in a film format.

[0037] The encoding computer 102 distributes the encoded video to areceiving device, which decodes the encoded video. The receiving devicecan correspond to a wide variety of devices that can display video. Forexample, the receiving devices shown in the illustrated networked systeminclude a cell phone 112, a personal digital assistant (PDA) 114, alaptop computer 116, and a desktop computer 118. The receiving devicescan communicate with the encoding computer 102 through a communicationnetwork 120, which can correspond to a variety of communication networksincluding a wireless communication network. It will be understood by oneof ordinary skill in the art that a receiving device, such as the cellphone 112, can also be used to transmit a video signal to the encodingcomputer 102.

[0038] The encoding computer 102, as well as a receiving device ordecoder, can correspond to a wide variety of computers. For example, theencoding computer 102 can be a microprocessor or processor (hereinafterreferred to as processor) controlled device, including, but not limitedto a terminal device, such as a personal computer, a workstation, aserver, a client, a mini computer, a main-frame computer, a laptopcomputer, a network of individual computers, a mobile computer, a palmtop computer, a hand held computer, a set top box for a TV, aninteractive television, an interactive kiosk, a personal digitalassistant, an interactive wireless communications device, a mobilebrowser, a Web enabled cell phone, a personal digital assistant (PDA) ora combination thereof. By way of example, an encoder computer may alsobe included in the camera 106, the cell phone 112, the PDA 114, thelaptop computer 116, and/or the desktop computer 118. The computer 102may further possess input devices such as a keyboard, a mouse, atrackball, a touch pad, or a touch screen and output devices such as acomputer screen, printer, speaker, or other input devices now inexistence or later developed.

[0039] The encoding computer 102, as well as a decoder computer, cancorrespond to a uniprocessor or multiprocessor machine. Additionally,the encoder and decoder computers can include an addressable storagemedium or computer accessible medium, such as random access memory(RAM), an electronically erasable programmable read-only memory(EEPROM), masked read-only memory, one-time programmable memory, harddisks, floppy disks, laser disk players, digital video devices, CompactDisc ROMs, DVD-ROMs, other optical media, video tapes, audio tapes,magnetic recording tracks, electronic networks, and other techniques totransmit or store electronic content such as, by way of example,programs and data. In one embodiment, the encoding and decodingcomputers are equipped with a network communication device such as anetwork interface card, a modem, Infra-Red (IR) port, a wireless networkinterface, or other network connection device suitable for connecting toa network. Furthermore, the computers execute an appropriate operatingsystem, such as Linux, Unix, Microsoft® Windows® 3.1, Microsoft®Windows® 95, Microsoft® Windows® 98, Microsoft® Windows® NT, Microsoft®Windows® 2000, Microsoft® Windows® Me, Microsoft® Windows® XP, Apple®MacOS®, IBM® OS/2®, Microsoft® Windows® CE, or Palm OS®. As isconventional, the appropriate operating system may advantageouslyinclude a communications protocol implementation, which handles allincoming and outgoing message traffic passed over the network, which caninclude a wireless network. In other embodiments, while the operatingsystem may differ depending on the type of computer, the operatingsystem may continue to provide the appropriate communications protocolsnecessary to establish communication links with the network.

[0040]FIG. 1B illustrates an example encoding system 100B in accordancewith an embodiment of the present invention. The term encoding system,as used herein, includes one or more encoders. The encoding system 100Bcomprises, by way of example, one or more of processors, program logic,or other substrate configurations representing data and instructions,which operate as described herein. In other embodiments, the encodingsystem 100B can comprise controller circuitry, integrated circuits, gatearrays, application specific circuits, processor circuitry, processors,general purpose single-chip or multi-chip microprocessors, digitalsignal processors, embedded microprocessors, microcontrollers and thelike, executing software code, including instructions and data stored incomputer readable memory. By way of example and not limitation, theencoding system 1 OOB can be housed in one or more leaded, leadless, orball grid array semiconductor packages, on one or more circuit boards,and/or using one or more hybrid packages. All or portions of theencoding system 100B may be included in a fixed terminal, such as adesktop computer, or in a portable terminal, such as a cellular phone,portable computer, personal digital assistant, video camera, or thelike. The encoding system 100B can, in an example embodiment, correspondto the encoding computer 102. By way of further example, an encodingsystem in accordance with the present invention can be used to conductvideo conferencing, to aid in the storage and transmission of movies orother images, and the like.

[0041] The encoding system 100B encodes and compresses video informationfor transmission to a decoder. The encoding system 100B includes apreprocessing module or circuit 102B, a bit allocation module or circuit104B, and an encoder module or circuit 106B. The preprocessing module orcircuit 102B, including a video sequence analyzer, is used to detectwhen a scene change has taken place and to determine how a given frame,VOP or picture, is to be encoded.

[0042] A video object layer contains a sequence of 2D representations ofarbitrary shape at different time intervals that is referred to inMPEG-4 as a video object plane (VOP). Each of the VOP regions can benon-rectangular and may correspond to particular image or video contentof interest, such as physical objects within a scene. Video objectplanes (VOPs) are divided into macroblocks of size 16×16. A macroblockis encoded in six blocks, four for luminosity and two for chromaticity,of size 8×8. To obtain a macroblock structure from an arbitrary shapedVOP, the bounding box of the VOP is calculated and extended to multiplesof the macroblock size.

[0043] However, for most current applications, and in particular forwireless applications using the so-called “simple profile,” there isgenerally only 1 VOP per frame, which is a rectangular VOP. For clarity,the term frame, as used herein, can also include a VOP, such as anMPEG-4 VOP, or a picture. Similarly, the term VOP, as used herein, canalso refer to a frame. In MPEG-4, the VOPs can be structured in groupsof video object planes (GOV). Using MPEG-2 terminology, frames orpictures can be arranged in groups of pictures (GOPs). For clarity, theterm “scene” as used herein, may also refer to a GOV or a GOP and visaversa.

[0044] A frame or video object may be encoded as an intracoded frame (an“I-frame” or “I-VOP”), as a predicted frame (a “P-frame” or “P-VOP”), oras a bi-directional frame (a “B-frame” or “B-VOP”). MPEG-1 also providesfor a D-frame. A D-frame is a frame that has no motion vectors, so thata zero vector is assumed, and has texture DCT data. To exploit spatialredundancy, a Discrete Cosine Transformation (DCT) is performed on theencoded frames and the resulting coefficients are quantized.

[0045] The MPEG-4 simple profile does not support B-frames or B-VOPs.However, the simple profile does support frame skipping. A video framecan be skipped in order to reduce the resulting file size or bit-rate.Because the MPEG-4 simple profile does not support B-frames or D-frames,the following discussions will not focus on such frames. Nonetheless,embodiments of the present invention can be used with B-frames andD-frames in accordance with other profiles and other standards.

[0046] The term frame can correspond to either an interlaced frame or toa non-interlaced frame, i.e., a progressive frame. In an interlacedframe, each frame is made of two separate fields, which are interlacedtogether to create the frame. Such interlacing is not performed in anon-interlaced or progressive frame. While illustrated in the context ofnon-interlaced or progressive video, one or ordinary skill in the fieldwill appreciate that the principles and advantages described herein areapplicable to both interlaced video and non-interlaced video. Inaddition, while embodiments of the invention are described in thecontext of MPEG-4, aspects of the principles and advantages describedherein are also applicable to other video standards, including, by wayof example, MPEG-1, MPEG-2, H.261, H.262, H.263, H.263+, H.263++, andH.26L, as well as video standards yet to be developed.

[0047] An intracoded I-frame typically only includes information fromthe image itself and thus an I-frame can be decoded independently ofother frames. P and B frames are also referred to as intercoded framesbecause they are encoded based on data from other frames. Thepreprocessing module 102 generates a file, referred to as an inputframe-type file, containing the frame-type designations corresponding tothe frames. In other embodiments, the frame-type information is passedto other portions of the encoding system 100B using variables and thelike. While the preprocessing module 102B is illustrated in FIG. 1B asbeing included in the encoding system 100B, the preprocessing module102B can be physically separate from the other portions of the encodingsystem 100B. In such an embodiment, the preprocessing module 102B canproduce a text file that includes frame-type designation that is theninput by the remainder of the encoding system 100B.

[0048] Many standard MPEG-4 encoders can only handle one scene, that is,one I-frame followed by P-frames or B-frames, or they introduce regularI-frames every k frames, as is commonly done in MPEG-2 encoding. Theseapproaches make implementation of the encoder simpler, however theyplace the burden on the user to determine how clips of multiple scenesare to be handled. To adequately improve the coding efficiency, thenumber of I-frames should be reduced or minimized. In the absence oferror conditions, I-frames are preferably used in scene-changes only.Thus, it is advantageous to correctly and accurately detect scenechanges.

[0049] An example scene change detection process in accordance with anembodiment of the present invention will now be described. In theexample embodiment, the process operates on YUv-4:2:0 files and producesa text file as an output. In the example embodiment, YUV-4:2:0 files areheader-less files with concatenated frames, where, for each frame, the(luminosity) Y-pixel values are provided first, followed by the(Chromaticity-blue) Cb-values, and then the (Chromaticity-red)Cr-values. The term “4:2:0” indicates that chromaticity values aresubsampled by a factor 4 with respect to luminosity. In particular, ifthe size of a frame (in pixels) is W×H (W: width, H: height), there areW*H Y-values (1 for each frame pixel), (W/2)*(H/2) Cb-values and(W/2)*(H/2) Cr-values for each frame. That gives a total of 3*W*H/2bytes as the frame buffer size needed to store a frame of size W×H. Thesubsampling for chromaticity components is achieved by subsampling alongthe vertical and horizontal dimensions by a factor of 2. Thus, a 2×2block has 4 luminosity values, and 1 chromaticity-blue and 1chromaticity-red. In other embodiments, other formats for storing imagedata can be used.

[0050] The preprocessing module 102B will now be described in greaterdetail. The preprocessing module 102B performs frame evaluation andencoding designation. As will be described below, each frame isdesignated by the preprocessing module 102B as an I-frame, a P-frame, oras a skipped frame. In other embodiments, the preprocessing module 102Bmay also designate frames as B-frames or D-frames. B-frame encoding maybe performed if there is sufficient computational power, availablebandwidth (B-frames take much more bandwidth than skipped frames), andif allowed by the corresponding standard. For example, the MPEG-4simple-profile syntax, used in wireless networks, does not allow forB-frames. The example file format generated by the preprocessing module102B includes a line per input frame, with a frame-type designationcharacter on each line: 0, 1 or 2. A “0” indicates an I-frame, a “1”indicates a P-frame, and a “2” indicates a skipped frame. In otherembodiments, designations can be provided for a bidirectional frame anda D-frame.

[0051] As previously discussed, scene change frames are generallyintracoded. To locate the scene change frames, the preprocessingmodule's scene change analysis performs a color-weighted Root MeanSquared (RMS) calculation and a Mean Absolute Differences (MAD)calculation between the i^(th) frame F_(i) and the k^(th) frame F_(k).The RMS can be defined as: $\begin{matrix}{{{RMS}\left( {F_{i},F_{k}} \right)} = {{\frac{\alpha}{\alpha + \beta + \gamma}\sqrt{\frac{1}{w \times h}{\sum\limits_{x = 1}^{w}{\sum\limits_{y = 1}^{h}{{{Y_{i}\left( {x,y} \right)} - {Y_{k}\left( {x,y} \right)}}}^{2}}}}} + {\frac{2\beta}{\alpha + \beta + \gamma}\sqrt{\frac{1}{w \times h}{\sum\limits_{x = 1}^{w/2}{\sum\limits_{y = 1}^{h/2}{{{U_{i}\left( {x,y} \right)} - {U_{k}\left( {x,y} \right)}}}^{2}}}}} + {\frac{2\gamma}{\alpha + \beta + \gamma}\sqrt{\frac{1}{w \times h}{\sum\limits_{x = 1}^{w/2}{\sum\limits_{y = 1}^{h/2}{{{V_{i}\left( {x,y} \right)} - {V_{k}\left( {x,y} \right)}}}^{2}}}}}}} & \text{Equation~~1}\end{matrix}$

[0052] where F(x, y) denotes the (x, y)^(th) pixel in frame F, and w andh are the width and height of the frame, respectively. Y(x, y) indicatesthe luminance value, while U(x, y) and V(x, y) are the two chromaticitycomponents. The coefficients, and are weighting coefficients for theluminosity, chromaticity-blue and chromaticity-red componentscorrespondingly. To ease computations, the weighting coefficients can befixed. For example, the weighting coefficients can be set as follows:===1.

[0053] The Mean Absolute Difference (MAD) measure can be defined asfollows: $\begin{matrix}{{{MAD}\left( {F_{i},F_{k}} \right)} = {\frac{1}{w \times h}{\sum\limits_{x = 1}^{w}{\sum\limits_{y = 1}^{h}{{{Y_{i}\left( {x,y} \right)} - {Y_{k}\left( {x,y} \right)}}}}}}} & \text{Equation~~2}\end{matrix}$

[0054] In this example, the MAD does not need to include the twochromaticity components.

[0055] If MAD(F_(i),F_(k)) and/or RMS(F_(i),F_(k)) are large or greaterthan a selected criteria, this indicates that the content of F_(i) issubstantially different from F_(k). Thus in one embodiment, if the MADbetween consecutive frames, MAD(F_(i−1),F_(i)), is larger than apre-specified threshold, F_(i) is designated a scene change frame. Anexample threshold value for designating a scene change frame isapproximately 25.

[0056] Optionally, a second temporal derivative of the RMS can be usedto determine if a frame is scene change frame, as follows:$\begin{matrix}{{\frac{d^{2}({RMS})}{d\quad t^{2}}(i)} = {{{RMS}\left( {F_{i - 1},F_{i}} \right)} - {2{{RMS}\left( {F_{i},F_{i + 1}} \right)}} + {{RMS}\left( {F_{i + 1},F_{i + 2}} \right)}}} & \text{Equation~~3}\end{matrix}$

[0057] As defined by Equation 3, the second temporal derivative of theRMS is based on the RMS value for the previous frame F_(i−1), relativeto the current frame F_(i), the RMS value of the current frame F_(i)relative to the next frame F_(i+1), and the RMS value of the next frameF_(i+1) to the subsequent frame F_(i+2).

[0058] The second temporal derivative of the RMS value will be negativewith relatively high amplitude when F_(i) is a scene-change frame, asillustrated in FIG. 3. Thus, if the absolute value of the secondtemporal derivative of the RMS value is larger than a pre-specifiedthreshold, F_(i) is designated a scene change frame. As illustrated inFIG. 3, there is a correlation between the RMS values, indicated by thediamonds, and the second derivative of RMS, indicated by the triangles.Thus, both the RMS values the values of the second derivative of RMSgenerally provide a correct indication of a scene change. An examplesecond derivative of RMS threshold value for determining a scene changeis −6.5.

[0059] While the second derivative of the RMS is a good peak detector,it is somewhat sensitive to noise. To better increase the accuracy ofthe scene change determination, in one embodiment only if both thetemporal activity measures of MAD and the second-order derivative of RMSindicate that the corresponding thresholds are met or passed, then aframe is designated a scene change frame. As will be described below,scene changes frames will be intracoded as I-frames or I-VOPs.

[0060] In particular, in one example a frame is designated as a scenechange, and thus will be coded in INTRA mode, when its MAD is greaterthan 20 and the second derivative of RMS is negative and has an absolutevalue of greater than 4. In another example, a frame is designated as ascene change, and thus will be coded in INTRA mode, when its RMS isgreater than 40 and/or when the second derivative of RMS is negative andhas an absolute value of greater than 8. In other embodiments otherthresholds can be used. Alternatively or in addition, a secondderivative of MAD can be used, as similarly described above with respectto the second derivative of RMS, as a further indication of whether aframe corresponds to a scene change or not.

[0061] An additional criterion can be used to determine when a scenechange has occurred. For example, in one embodiment, a determination ismade as to whether the MAD value is a local maximum, that is, hasincreased from a previous frame to the frame at issue, and thendecreased from the frame at issue to the next frame. If so, thisindicates that it is likely the frame at issue is a scene change frameand should be intracoded. In addition, a similar determination may bemade for the RMS value. For example, a determination is made as towhether the RMS value is a local maximum, that is, has increased from aprevious frame to the frame at issue, and then decreased from the frameat issue to the next frame. If so, this too indicates that it is likelythe frame at issue is a scene change frame and should be intracoded.

[0062] Optionally, a voting process can be used, wherein if at least twoof the RMS, the second derivative of the RMS, and the MAD, meetcorresponding criteria, then a frame is designated as a scene changethat is to be intracoded. In another embodiment, if the RMS and secondderivative of the RMS meet the corresponding criteria, and if the MAD isa local maximum, then the frame is designated as a scene change frame.In still another embodiment, if the RMS and MAD meet the correspondingcriteria, and if the MAD is a local maximum, then the frame isdesignated as a scene change frame.

[0063] To further improve coding efficiency and to meet target bitrates, the number of frames that needs to be encoded per second ispreferably reduced as much as acceptable. One technique used to reducethe number of frames encoded per second is to skip-frames in theencoding process. Two example frame-skipping techniques are fixed frameskipping and adaptive frame skipping. Conventional encoders drop framesto reduce the frame rate according to a simple skipping algorithm. Forexample, a conventional encoder will drop every 4 of 5 frames in a videoclip to convert the video clip from a 30 frames per second rate to a 6frames per second rate.

[0064] As will be discussed below, fixed frame skipping tends to providebetter error resiliency in noisy environments, while adaptive frameskipping tends to provide better visual results in low noiseenvironments. Optionally, the preprocessing module 102B calculates,based on the bit-rate/frame-rate formula defined in Equation 7 below,the target encoding frame-rate and then switches between adaptive andfixed skipping in order to meet a target encoding frame rate.

[0065] In fixed frame skipping, the input video frame sequence issubsampled along the time axis, by keeping 1 in every k frames, where kis the subsampling factor. For example, if:

[0066] k=5

[0067] and the original video sequence has a frame rate=25frames-per-second (fps); then

[0068] the subsampled sequence has a frame rate=5 fps.

[0069] In adaptive frame skipping, as in fixed frame skipping, the inputvideo frame sequence is subsampled along the time axis in order toachieve a desired or predetermined average frame rate. However, ratherthan skip-frames in a fixed manner, using adaptive frame skipping therate of frame skipping can be irregular and can vary along the sequencelength. Preferably, low activity frames are identified and skipped, andscene-change frames are kept and intracoded. Non-scene changes havingsome activity frame are interceded. Because the skipped frames areintelligently selected based on changes on visual activity, the visualresult when reproduced by the decoder will be better than with fixedframe skipping, assuming no or relatively few errors occur.

[0070] In one embodiment, the preprocessing module 102B codes skippedframes using a “not_coded” bit-flag or indicator set in the video objectplane (VOP) header in an MPEG bit stream. An MPEG-4 video packet startswith the VOP header or the video packet header, followed bymotion_shape_texture( ), and ends with next_resync_marker( ) ornext_start_code). Thus, a VOP specifies particular image sequencecontent and is coded into a separate video object layer by codingcontour, motion and texture information.

[0071] In another embodiment, a skipped frame is skipped altogether,without inserting VOP-header information in the bitstream. A skippedframe may be recreated by a decoder using interpolation or by repeatinga previous frame. The decoder may perform interpolation by pixelaveraging between a preceding frame and a subsequent decoded frame,weighted by their time difference.

[0072] The information regarding the video sequence frame rate isnormally carried in the Video-Object-Layer (VOL) header. In particular,a parameter, referred to as vop_time_increment_resolution, determinesthe number of time units for each encoding cycle. The vop_time_incrementvalue in the Video-Object-Plane (VOP) header carries the time stamp foreach frame.

[0073] The vop_time_increment_resolution may be, by way of example, a 16bit unsigned integer value. For example, for 25 frames per second (fps),vop_time_increment_resolution=25, and vop_time_increment cycles throughthe values 0 . . . 24. For 7.5 fps, vop_time_increment_resolution=75,and vop_time_increment cycles through the values 0, 10, 20, 30, 40, 50,60, 70, 5, 15, 25, 35, 45, 55, 65. Thus, successful decoding of thefirst 2 frames of a sequence can yield the exact frame rate. But, giventhe error-prone environment of wireless communication or othererror-prone environments, the successful reception and decoding of any 2consecutive frames cannot be guaranteed. Thus, the decoder mayincorrectly determine the frame rate of the entire sequence. For thatreason, in one embodiment, the “fixed_vop_rate” flag is set by theencoder module 106B in the VOL header, which then provides (via thevalue of fixed_vop_time_increment) the default frame rate. Thistechnique better ensures the successful decoding or determination of theframe rate upon the successful decoding of the VOL header. Thefixed_vop_time_increment value can later be stored in a global variableof the decoder, which will use the value to determine whether certainframes need to be interpolated or not. The frames to be interpolated caneither be frames skipped by the encoder, or lost during transmission.Thus, the error-resilience performance of the MPEG-4 decoder will beenhanced because it will decode the correct number of frames, therebyavoiding loss-of-sync problems with the audio stream.

[0074] As discussed above, for error-prone environments, errorresiliency can be enhanced by utilizing fixed frame skipping rather thenadaptive frame skipping. Fixed frame skipping enables the decoder tobetter determine when a frame has been dropped or skipped. Anotherapproach to enhancing error resiliency is to use adaptive frameskipping, but provide a VOP-header with the not_coded flag set for askipped frame. One drawback of this approach is that it results in aslight increase in bit rate due to the more frequent VOP-headers.

[0075]FIG. 4A illustrates one example process 400 of adaptive frameskipping. The process is iterative in that a frame is selectivelydropped from the sequence of frames by computing a mean of absolutedifferences between the frames adjacent to the frame of interest, and byweighting the computation with a temporal parameter, wherein the framehaving the least impact on the scene is dropped. This procedure isrepeatedly iterated until a target frame rate, which is related to thedesired bit rate and frame size, is achieved.

[0076] Beginning at start state 402, the process 400 proceeds to state404. The desired frame rate is set or specified. The desired frame ratemay be user specified or may be dynamically determined. Proceeding tostate 406, the cost function, or adverse impact, that would result fromdropping a particular frame is calculated for each frame between thefirst and last frame in a scene. As described in greater detail below,the cost function can be based at least in part on the mean absolutedifferences (MAD) between frames closely or most closely bracketing orbounding the particular frame of interest, or on the sum of the meanabsolute differences (SMAD). Alternatively or in addition, the costfunction can be based on sums of RMS (SRMS) for frames bracketing theparticular frame of interest.

[0077] Proceeding to state 408, the frame associated with the lowestcost, that is, having the least adverse impact on visual quality, isskipped or dropped. At state 410 a determination is made as to whetherthe remaining frames will allow the target frame rate to be met. If thetarget frame rate can now be met, the adaptive frame rate skippingprocess 400 proceeds to the end state 414. Otherwise, the process 400proceeds to state 412, and a remaining frame having the lowest cost willbe dropped. The cost of all the frames remaining between the first andlast frames may be recalculated at state 412 based on the frames thatare currently remaining, and the frame with the lowest cost will bedropped. The process 400 repeats states 410 and 412 until the targetframe rate has been met, or the number of already consecutively skippedframes is at a specified maximum. While the process 400 is describedwith respect to selecting which frames to skip, the process 400 can besimilarly used to decide what frames should be bi-directionally encoded.

[0078] One example embodiment of an adaptive frame skipping selectionprocess using the weighted sum of mean absolute differences will now bedescribed in greater detail. Given an input sequence of a frame rater_(orig) and the desired frame rate r_(des) (where r_(orig)>r_(des)),the video sequence analyzer skips frames in a “greedy” way, that is,until r_(des) is met. The weighted sum of MAD and the time differencebetween two frames are used in specifying a cost function foridentifying the next frame to be skipped. The frame whose cost functionmeets predetermined criteria or is minimum among remaining candidatesfor skipping is skipped.

[0079] By way of example, referring to FIG. 4B, if using the greedyapproach F₃, F₅, F₆, and F₈ have already been skipped, F₄ is nowconsidered as a candidate for the next skipped frame. In order todetermine if F₄ is to be skipped, a cost function is calculated assumingthat F₄ has been skipped. Upon skipping F₄, F₂ and F₇ will be the leftand right frames bounding the skipped segment of F₃-F₆. The costfunction is then defined as: $\begin{matrix}{{Cost} = {{{MAD}\left( {F_{2},F_{7}} \right)} + {\lambda \frac{29.97}{r_{orig}}{TD}}}} & \text{Equation~~5}\end{matrix}$

[0080] Where the term $\frac{29.97}{r_{orig}}$

[0081] is used to normalize the original frame rate r_(orig) withrespect to the NTSC frame rate of 29.97 frames/second and where TDdenotes the time difference measure. Of course other or differentnormalizations may be used as well.

[0082] Thus, in this example TD is 5 (=7−2), and A is a weightingcoefficient. In this example, the weighting coefficient value=5.0,determined experimentally, provides a suitable result. Alternatively,the weighting coefficient value may be dynamically determined. At thecurrent state, the frame whose cost function is minimum among thecandidates is skipped. This process is iteratively performed until thedesired frame rate is met. The time difference measure TD can bemodified such that no more than n consecutive frames are skipped. Forexample, if a predetermined maximum number of consecutive frames thatcan be skipped simultaneously is set to 4, TD can be modified as follows${TD}^{\prime} = \left\{ {\begin{matrix}{TD} & {{\text{if}\quad {TD}} \leq 5} \\\infty & \text{otherwise}\end{matrix}\text{where~~∞~~is~~infinity}} \right.$

[0083] Optionally, the complexity for the MAD calculation can bereduced, though the accuracy will be reduced, if only even (or only odd)coordinate pixels are used in the calculation. For example:$\begin{matrix}{{{MAD}\left( {F_{i},F_{k}} \right)} = {\frac{1}{{w/2} \times {h/2}}{\sum\limits_{x = 1}^{w/2}{\sum\limits_{y = 1}^{h/2}{{{Y_{i}\left( {{2x},{2y}} \right)} - {Y_{k}\left( {{2x},{2y}} \right)}}}}}}} & \text{Equation~~6a}\end{matrix}$

[0084] Another example process to adaptively determine which frame toskip estimates the total induced distortion, both spatial and temporal,for each candidate frame for skipping, and then skips the frame whoseabsence would result in the least distortion. As described below, theprocess utilizes sums of MAD (SMAD) or sums of RMS (SRMS).Advantageously, all the MADs do not have to be recalculated. Instead,the already calculated appropriate MADs are summed differently,depending on which frame is being considered for skipping.

[0085] In one embodiment, the process is performed as follows. Assumethat F_(i) is the frame currently being considered for skipping. Forexample, assume F_(i) is frame F₄ in FIG. 4B. Then let F_(j) indicatethe previous non-skipped frame, F₂ in this example, and let frame F_(k)indicate the next non-skipped frame, F₇ in our example. Then the costfunction can be defined as follows: $\begin{matrix}{{Cost} = {{{{{SMAD}_{est}\left( {F_{j},F_{k}} \right)} - {{SMAD}_{est}\left( {F_{j},F_{i}} \right)} - {{SMAD}_{est}\left( {F_{i},F_{k}} \right)}}} + {\lambda \frac{29.97}{r_{orig}}{TD}}}} & \text{Equation~~6b}\end{matrix}$

[0086] where SMAD_(est)(F_(i),F_(k)) is the estimated spatial distortionwhen skipping frames (i+1), (k−1).

[0087] As can be seen from Equation 6b, the cost function subtracts outthe contribution from previously skipped frames. The distortion iscalculated as follows: $\begin{matrix}{{{SMAD}_{est}\left( {F_{j},F_{k}} \right)} = {{{\phi \left( {k - i - 1} \right)} \cdot \frac{k - i - 1}{k - i}}{\sum\limits_{j = {i + 1}}^{k}{{MAD}\left( {F_{j - 1},F_{j}} \right)}}}} & \text{Equation~~6c}\end{matrix}$

[0088] where φ(n) is a coefficient that depends on the number (n) ofconsecutive skipped frames and takes into account how much, on theaverage or based on a statistical sampling, interpolated frames at thedecoder are different from the original frames. The following tableprovides example coefficient values determined experimentally usingtypical video sequences: Adaptive Frame Skipping Coefficient Table n 0 12 3 4 5 6 >=7 φ(n) 0.0 0.746 0.886 1.010 1.198 1.276 1.348 1.500

[0089] As can be seen, φ(n) increases as the number of skipped framesincreases.

[0090] To reduce the computational complexity and resources needed,optionally only the MAD between consecutive frames (j−1 and j) is usedto estimate the distortion of a complete segment of skipped frames, asin Equation 6b above. The additional distortion when skipping a certainframe is calculated and the temporal component is added.

[0091] In one embodiment, a user specifies the desired encoding framerate. The desired frame rate can be based on the video sequencestatistics, such as temporal and spatial complexity, frame size, framerate and target bit rate or compression ratio. In another embodiment, aheuristic can be used to select the desired frame rate. The following isan example heuristic equation for calculating the frame rate, normalizedwith respect to the Quarter Common Intermediate Format (QCIF) framesize, containing 144 lines and 176 pixels per line: $\begin{matrix}{\text{Encoding~~frame~~rate} = \frac{\text{target~~bit~~rate~~in~~kbps}}{8\sqrt{\frac{176*144}{w*h}}}} & \text{Equation~~7}\end{matrix}$

[0092] where w and h are the frame dimensions. In order for the encodingframe rate to remain within reasonable bounds, the encoding frame rateshould preferably be in the range of:

[0093] [1 up to, and including, the source frame rate]

[0094] In addition, in order to make adaptive frame skipping independentof the temporal complexity of a specific scene, the weightingcoefficient is optionally set equal to the average RMS or MAD of thedesignated entire sequence.

[0095] Thus, to determine which frames are scene change frames, and toadaptively select which frames are to be skipped, the video sequenceanalyzer is provided with the video sequence, the frame width, frameheight, the source frame rate, the target bit rate, and the setting ofthe error resilience flag in the following format:

[0096] <input file><width><height><source frame rate><target bitrate><error resilience flag>

[0097] The error resilience flag is set by the user to switch betweenadaptive frame skipping, which has less error resiliency but a bettervisual result when there are no or few errors, and fixed frame skipping,which provides better error resiliency with a lesser visual result.

[0098] In one embodiment, as illustrated in FIG. 1C, an RMS circuit 102Cis used to calculate RMS values as described above, a Second Derivativeof RMS circuit 104C is used to calculate the second derivative of RMS asdescribed above, a MAD circuit 108C is used to calculate the MAD valuesas described above, a SUM OF MAD circuit 110C. is used to calculate theSUM of MAD values as described above, and a Second Derivative of MADcircuit 114C is used to calculated the Second Derivative of MAD asdescribed above. An Evaluator circuit 112C coupled to the outputs of theRMS circuit 102C, the Second Derivative of RMS circuit 104C, the MADcircuit 108C, and the SUM OF MAD circuit 110C, and the Second Derivativeof MAD circuit 114C, is used to determine when a scene change hasoccurred and what frames to skip, based on one or more of the outputs,as discussed above. Of course different embodiments need not include allor any portion of the circuits illustrated in FIG. 1C.

[0099] The bit allocation module or circuit 104B will now be described.The bit allocation module or circuit 104B provides for bit allocation ona scene, frame, and/or macroblock level. The bit allocation module 104Breads the file or otherwise receives the information generated by thepreprocessing module 102B, including the frame-type designations, andcalculates a bit budget for each scene, GOV or GOP based on the codedframes. The bit allocation module determines an appropriate distributionof a fixed bit budget.

[0100] As will be described below with respect to an exampleimplementation, a first intracoded frame defines a beginning of a scene.A weight is assigned to the scene based on the number of intracodedframes and the number of intercoded frames, where intracoded frames areweighted more heavily then intercoded frames to account for the greaternumber of bits needed to encode an intraframe. The bit allocation moduledistributes the fixed bit budget within a scene by comparing the currentbit usage and target bit usage, and based on the comparison, adjusts aquantization parameter or step size for the current frame.

[0101] In particular, the bit-allocation module 104B first parses theinput frame-type file from the preprocessing module 102B. The number orquantity of GOVs is then calculated. Based on the calculated bit budget,the encoder module 106B then encodes each GOV using the novel ratecontrol process in accordance with an encoder parameter file, discussedbelow.

[0102] For a given GOV or scene, the number of coded frames and thefirst and end frame are known. Using the following definitions, the bitbudget for a GOV or scene is calculated using Equation 8 below:

[0103] N_(ci)=number of coded P-VOPs (predicted, interceded VOPs) inscene_(i) or GOVi.

[0104] B_(i) bit budget for scene i.

[0105] B=bit budget for a clip including one or more scenes

[0106] N_(c)=number of coded frames for the clip

[0107] N_(s)=number of scenes in clip. Usually, in the absence of theinclusion of consecutive I-frames for error resilience purposes,N_(s)=the number of I-VOPs (intracoded VOPs)

[0108] T_(c)=equivalent total number of VOPs in clip

[0109] An example method of determining the bit-budget for a scene orGOV is as follows. B_(i) bits are allocated for each GOV (i). In thisexample allocation, an assumption is made that the bit usage for oneI-frame or I-VOP is close to or equal to the bit-usage of ten P-framesor P-VOPs (Ratio_Of_I_to_P=10). However, the method is not limited tousing the 1:10 ratio. B_(i) and T_(c) are then determined as follows:

B _(i) =B*(N _(ci)+Ratio_Of_I_to_P)/T_(c)  Equation 8

[0110] and

T _(c) =N _(c)+(Ratio_Of_I_to_P)/T_(c)  Equation 9

[0111] As defined by Equation 8, the bit allocation for a given scene isbased on the total number of frames in the scene, wherein an intracodedframe is normalized to be the equivalent of several predicted frames. Inorder to reduce the complexity and computational overhead, this examplebit allocation formula does not take into account the spatial andtemporal complexity of each GOV or GOP. In other embodiments, ifsufficient computational and time resources are available, the bitallocation formula takes the temporal and spatial complexity intoconsideration to provide a still more intelligent bit allocation foreach GOV.

[0112] For example, in one embodiment a two-pass encoding process isused that takes into account spatial and temporal complexity. The firstpass detects scene changes and collects frame complexity. The secondpass performs the actual encoding using complexity guided bitallocation.

[0113] The first pass process will now be described in greater detail. Anew GOV or GOP is started from a scene change instance. The two-passrate control process provides substantially uniform quality for eachtemporally segmented GOV so that quality variation is better limited toGOV or GOP boundaries. This approach is taken because minimizing qualityvariation, as measured by the Peak Signal to Noise Ratio (PSNR), theRoot Mean Square Error or other image fidelity metric, among differentscenes provides less benefit with respect to human visual perception.

[0114] In characterizing the relative frame complexity, the complexitymeasure in accordance with one embodiment of the present invention isrelatively invariant with the quantization parameter (QP) used. Inparticular, generally the bit count for non-texture information, such asframe headers/syntax and motion vectors, denoted by H₁, is constant oralmost constant in terms of quantization parameter (QP) change. This isin contrast to the bit count of the texture information, which does varywith a change in QP. By way of example, based on the MPEG-4 VM R-Q model[MPEG4VM], if the total number of bits used for coding the current framei is R₁, then the texture bits T_(i)=R_(i)−H_(i) can be represented as:$\begin{matrix}{\frac{R_{i} - H_{i}}{M_{i}} = {\frac{a_{1}}{Q_{i}} + \frac{a_{2}}{Q_{i}^{2}}}} & \text{Equation~~10}\end{matrix}$

[0115] where M_(i) is the MAD computed with a motion-compensatedresidual that is substantially invariant with respect to the QP (i.e.,Q₁), and a₁ and a₂ are Taylor expansion coefficients of texture bitsT_(i) over QP. The coefficients a₁ and a₂ are normally of the sameorder, that is, have similar values. As can be seen, the lower the QP,the greater then number of texture bits needed to encode a given frame.

[0116] The complexity measure C_(g,i) addresses both the motion andtexture bit count, and is substantially QP invariant. In one embodiment,C_(g,i) is defined by the ratio of the texture bit count for a givenframe to the average texture bit count, and the ratio of the motionvector bit count for the given frame to the average motion vector bitcount, as follows:

C _(g,i)=(R _(g,i) −H _(g,i))/{overscore (R _(g) −H _(g))}+MV_((g, i))/{overscore (MV_(g))}  Equation 11

[0117] where the MV_((g,i)) is the motion vector bit count forframe(g,i), {overscore (MV_(g))} is the average motion vector bit count,and {overscore (R_(g)−H_(g))} is the average texture bit count. Becausethe obtained complexity measure C_(g,i) is substantially QP invariant,the frame complexity can be generated in one pass, that is, with one QP.The calculated frame complexity will be utilized in the second encodingpass as will now be described.

[0118] As illustrated in FIG. 9, the rate control process 900 in thesecond pass consists of a three level hierarchy, scene (GOV orGOP)-level bit allocation 902, frame-level bit allocation 904, andmacroblock-level QP adjustment 906 which utilizes the obtained framecomplexity values C_(g,i).

[0119] Complexity-guided scene, GOV, or GOP, level bit allocation willnow be described with reference to FIG. 10. To assign bits to eachscene, the complexity measure is defined for each GOV or GOP bycalculating the average spatial complexity {overscore (C)}^((g)) asfollows: $\begin{matrix}{{\overset{\_}{C}}^{(g)} = {\sum\limits_{i}{C_{g,i}/N_{g}}}} & \text{Equation~~12}\end{matrix}$

[0120] Then, the GOV or GOP level recursive bit allocation process 1000is applied, as illustrated in FIG. 10. At state 1002, an initializationprocess is performed, with the following assignments:

[0121] λ=0

[0122] Bit budget Br (bit allocation for a given time windowcorresponding to a certain number of GOVs or GOPs) B

[0123] The initial transmit buffer fullness β₁=T_(d)×R

[0124] Start from GOV or GOP of index 1, that is, the first GOV or GOP.

[0125] At state 1004, bits are assigned to the scene (GOV or GOP) ofindex g according to the following formula: $\begin{matrix}{B_{t{(g)}} = {{\lambda \times \left( {R/F} \right) \times N_{(g)}} + {\left( {1 - \lambda} \right) \times \frac{C_{g} \times N_{g}}{\sum\limits_{i}{C_{i} \times N_{i}}} \times B_{r}}}} & \text{Equation~~13}\end{matrix}$

[0126] Where:

[0127] R=the channel rate

[0128] F=the selected frame rate

[0129] N_((g))=the number of frames in GOV or GOP of index g

[0130] =the weighting factor between the buffer variation and complexitydemands. and

Σ_(i)C_(i)×N_(i)

[0131]  defines the total scene complexity for the given time windowcorresponding to the GOVs or GOPs under consideration

[0132] The case of λ=0 represents the bit allocation scheme thatdirectly follows the frame complexity, which is preferred if thetransmit buffer constraints can be met. The assignment λ=1.0 representsthe case where the bit budget is evenly distributed without consideringthe frame complexity. In this case, little pre-loading and a smallcapacity of the decoder buffer are needed as only the first frame needsto be pre-fetched. The case with 0<λ<1.0 represents a bit-allocationtradeoff between the buffer and the quality constraints.

[0133] At state 1006, the buffer status is inspected with thetentatively assigned bit budget B_(t(g)), if

β_(g−1) +B _(t(g))−(R/F)×N _((g))<MarginFactor1×β_(max)

[0134] where, by way of example, MarginFactor1=0.8, which provides asafe margin (0.8 of the maximum buffer size) for buffer regulation.

[0135] then the allocation is accepted, and the process 1000 proceeds tostate 1008. Otherwise, the value of λ is adjusted upwards by a factor,such as 0.1, and the process 1000 proceeds back to state 1004.

[0136] At state 1008 the buffer status is updated as follows:

β_(g)=β_(g−1) +B _(t(g))−(R/F)×N _((g)),

[0137] and the remaining budget B_(r) is adjusted as follows:

B_(r)−B_(t(g)).

[0138] The process 1008 then proceeds back to state 1002 and the valueof λ is set equal to 0. The allocation for the next GOV or GOP of indexg+1 is then performed.

[0139] The GOV or GOP scene-level bit allocation advantageously suitablyallocates the bit budget to each GOV or GOP while meeting both thebuffer and the quality constraints. However, to obtain a constant orconsistent quality within each GOV or GOP, it is preferable to allocatethe bit budget according to frames within each GOV or GOP based on framecomplexity and while still meeting buffer constraints. The frame levelbit allocation process 904 illustrated in FIG. 9 performs such a framebit allocation process, and is similar to the process 1000 for the GOVor GOP level bit allocation. However, rather then using variablescorresponding to a GOP or a GOV, the variables corresponding to framesare utilized. Thus, for frames

B _(f)=×(R/F)+(1−)×C _((g,i)) ×Bg′/(C _(g′))  Equation 14

[0140] where:

[0141] Bg′=running bits=(Bit allocation for current GOP−used bits forframes already coded)

[0142] Cg′=running complexity=(complexity for current GOP−complexity offrames already coded)

[0143] R=target bit rate

[0144] F=frame rate

[0145] In one embodiment, the macroblock level QP adjustment 906 can bealternatively performed in accordance with the following description. Inthe scene and the frame level bit allocation processes described above,a safe margin (0.8 of the maximal buffer by way of example) is providedfor buffer regulation. To reduce computational complexity, in onealternative embodiment, all the macroblocks are quantized with the samequantization parameter (QP) using a one-pass rate control. The QP valueis determined as part of the frame level rate control using thefollowing iterative process: If B_(actual)(i)>1.15*B_(t)(i), thenQP_(i+1)=QP_(i)+1. If B_(actual)(i) ≦ 1.15*B_(t)(i) then ifB_(actual)(i)<0.85* B_(t)(i) QP_(i+1)=QP_(i)−1 else QP_(i+1)=QP_(i).//To ensure that QP_(i+1) is within the valid QP range of 1-31, thefollowing clipping operation is performed QP_(i+1)=max(QP_(i+1), 1);QP_(i+1)=min(QP_(i+1), 31).

[0146] However, if the buffer is relatively small, then the macroblocklevel rate control process as described below can be used.

[0147] Suppose N_(MB) is the number of macroblocks in one frame, MAD_(k)is the mean absolute difference of MB k, and QP_(k−1) is the QP for aprevious macroblock. Then the QP for the current MB k can be in therange of [QP_(k−1)−2, QP_(k−1)+2], as determined in accordance with thefollowing rules: $\begin{matrix}{{QP}_{k} = \left\{ \begin{matrix}{{{QP}_{k} - {2\quad \text{if}\quad R_{k - 1}}} > {1.5 \times B_{k - 1} \times \left( {{MAD}_{k - 1}/{\sum\limits_{k - 1}^{N_{MB}}{MAD}_{m}}} \right)\quad \text{else}}} \\{{{QP}_{k} - {1\quad \text{if}\quad R_{k - 1}}} > {1.25 \times B_{k - 1} \times \left( {{MAD}_{k - 1}/{\sum\limits_{k - 1}^{N_{MB}}{MAD}_{m}}} \right)\quad \text{else}}} \\{{{QP}_{k} + {2\quad \text{if}\quad R_{k - 1}}} < {0.67 \times B_{k - 1} \times \left( {{MAD}_{k - 1}/{\sum\limits_{k - 1}^{N_{MB}}{MAD}_{m}}} \right)\quad \text{else}}} \\{{{QP}_{k} + {1\quad \text{if}\quad R_{k - 1}}} < {0.8 \times B_{k - 1} \times \left( {{MAD}_{k - 1}/{\sum\limits_{k - 1}^{N_{MB}}{MAD}_{m}}} \right)\quad \text{else}}} \\{QP}_{k}\end{matrix} \right.} & \text{Equation~~15}\end{matrix}$

[0148] Optionally, in high noise environment, the macroblock bitallocation process can be disabled or not used so that the decoder canassume that the QP is the same for each macroblock. This helps preventthe decoder from using the wrong QP when portions of a frame have beencorrupted or lost.

[0149] After determining the bit budget for each GOV or GOP, a novelrate control process, also referred to as IMP4, is used to meet orsubstantially meet the calculated bit budget. Conventional MPEG-4 ratecontrol does provide adequate performance for many applications. Forexample, many conventional rate control processes do not explicitlysupport multiple scenes. Instead, these conventional rate controlprocesses assume that an entire sequence comprises a single scene, andtherefore fail to provide for satisfactory rate control. By contrast, anembodiment of the present invention takes into account when scenechanges occur, and so provides enhanced rate control.

[0150] In one embodiment of the present invention, a self-convergingrate control processed is used to meet the bit budget of each GOV byadjusting the quantization parameter QP of each frame, where QP is equalto half the quantization step size. In MPEG-4, the quantizer parameterQP can have 31 values [1-31]. The rate control process determines the QPbased on past bit usage, the number of un-coded frame and the rest bitsfor a given GOV. Thus, if the current bit usage exceeds the assigned bitbudget by more than a certain amount or percentage, the quantizationparameter, and therefore the quantization step size, are increased. If,instead, the current bit usage falls beneath the assigned bit budget bymore than a certain amount or percentage, the quantization parameter,and therefore the quantization step size, are decreased. The process canbe performed in accordance with the following example pseudo-code:if(current bit usage>assigned bit budget*Margin1)QP_(next)=min(31,INT(QPcur+StepUpPrcnt* QPcur)); Else if(current bitusage<assigned bit budget*Margin2)QP_(next)=max(1,INT(QPcur−StepDwnPrcnt* QPcur)); End if. Where:

[0151] Margin1 is a constant that allows the current bit usage to exceedthe assigned bit budget, so that the system has an opportunity tostabilize. For example, Margin1 can be set equal to 1.15, allowing thecurrent bit usage to exceed the assigned bit budget by 15%.

[0152] Margin2 is a constant that allows the current bit usage tounder-run the assigned bit budget, so that the system has an opportunityto stabilize. For example, Margin2 can be set equal to 0.85, allowingthe current bit usage to under-run the assigned bit budget by 15%.

[0153] StepUpPrcnt is constant related to how much the quantizationparameter is to be increased. For example, StepUpPrcnt may be set equalto 0.1.

[0154] StepDwnPrcnt is constant related to how much the quantizationparameter is to be increased. For example, StepDwnPrcnt may be set equalto 0.1.

[0155] After encoding each GOV, the actual bit usage B_(act) is comparedwith the pre-assigned bit budget B_(ass), and if the actual bit usagevaries by more then a certain amount or percentage (Margin3, Margin 4)from the budgeted bit usage, the quantization parameter QP for anI-frame (QPI) is adjusted up or down by a certain amount (StepUp,StepDwn) or percentage as needed. The quantization parameter adjustmentprocess can be performed in accordance with the following examplepseudo-code: If(B_(act)>Margin3 * Bass) QPI=QPI+StepUp; Else if(B_(act)<Margin4 * B_(ass)) QPI=QPI - StepDwn; End if Where, by way ofexample: Margin3 = 1.2 Margin4 = 0.8 StepUp = 2 StepDwn = −2

[0156] The initial value of QPI may be set to 10, while the initialvalue of QP for a P-VOP may be set to 12. Note that when thequantization parameter QPI for I-VOP is changed, the QP assignment ofthe following P-frames may also change.

[0157] In one embodiment, the encoder module 106B then performs adaptivemotion change detection to efficiently reduce large propagation errors.In particular, adaptive intra refresh (AIR) is used to reduce errorpropagation in an MPEG data stream by the selective intra-coding ofmacroblocks in p-frames. Thus, AIR is used to help determine how manymacroblocks should be intra-encoded in the detected motion region of aframe. While the performance of macroblock intra-refresh increases errorresilience of the compressed bitstream, increasing the number ofintra-coded macroblocks correspondingly increase the number of bits usedto encode these macroblocks. Further, if there is a fixed bit rate, thequantization error has to increase for the other, non-intracoded,macroblocks. Thus, preferably, bandwidth and the bit error probability(BER) are taken into account to determine the percentage or number ofmacroblocks that are to be intracoded.

[0158] In addition, the encoder module 106B optionally used Cyclic IntraRefresh (CIR) to encode a predetermined number of macroblocks (MBs) ineach frame. Thus, CIR provides periodic intra-refresh to constrainpossible error propagation.

[0159] In one embodiment, Cyclic Intra Refresh (CIR) and Adaptive IntraRefresh (AIR) are performed as follows. The number of Intra macroblocksin a VOP is specified by the user in the encoder parameter file. Thenumber of Intra macroblocks in a VOP depends on target bit rate, framerate, bit buffer usage, channel noise feedback, and other transmissionrelated parameters. The encoder module 106B estimates the amount ofmotion for each macroblock and selects heavy motion area to be encodedin INTRA mode to enhance error resiliency. The results of the estimationare recorded a refresh map at the macroblock level.

[0160] An example conventional refresh map 202 is illustrated in FIG.2A. The encoder module 106B refers to the refresh map and selectivelydetermines whether to encode a given macroblock of the current VOP inINTRA mode or not. The estimation of motion is performed by comparingSAD (Sum of the Absolute Difference) and SAD_(th). SAD refers to the Sumof the Absolute Differences value between the current macroblock and themacroblock in the same location of the previous VOP. Advantageously, theSAD is already calculated when performing motion estimation. Therefore,the SAD calculation does not have to be repeated as part of the AIRprocess. SAD_(th) is used as a threshold value in determining whether agiven macroblock is a motion area. If the SAD of the current macroblockis larger then SAD_(th), this macroblock is regarded as motion area.

[0161] Once a macroblock is regarded as a motion area, it remains as acandidate motion area until it is encoded in Intra mode a predeterminednumber of times. In the example refresh map 202 illustrated in FIG. 2A,the value for this “predetermined number of times” is set “1,” in otherembodiments, the predetermined number of times can be set equal to 2, ora higher value. Horizontal scanning is used to resolve among macroblocksthat are candidates to be encoded in Intra mode within the moving areaas illustrated in map 204 in FIG. 2B.

[0162] With reference to FIG. 8A, conventional AIR processing, asapplied to four sample sequential VOPs, will now be explained in greaterdetail. The AIR refresh rate, that is, the fixed number of Intramacroblocks in a VOP is preferably determined in advance. In thisexample, the number of Intra macroblocks in a VOP is set to “2”.

[0163] [1] 1st VOP—FIG. 8A[a] and [b]

[0164] The first VOP is a scene change frame containing elements 802,804. Therefore, all macroblocks in the 1st VOP are encoded in Intramode, as illustrated in FIG. 8A[a]. As illustrated in FIG. 8A[b], therefresh map is set to “0”, where a 0 indicates that an Intra refresh isnot to be performed and a 1 indicates that an Intra refresh is to beperformed, because the 1st VOP is encoded without reference to aprevious VOP.

[0165] [2] 2nd VOP—FIG. 8A[c]-[f]

[0166] The 2nd VOP is interceded as a P-VOP. Elements 802, 804 havemoved down one macroblock and to the right by one macroblock. Intrarefresh is not performed in this VOP, because all values in the refreshmap are still zero, as illustrated in FIG. 8A[c]. The encoder module106B estimates motion of each macroblock. If the SAD for a givenmacroblock is larger than SAD_(th), the given macroblock is regarded asmotion area, illustrated by the hatched area in FIG. 8A[e]; thus, therefresh map is updated as illustrated in FIG. 8A[f], where the refreshmap entry corresponding to a motion macroblock is set to 1.

[0167] [3] 3rd VOP—FIG. 8A[g]-[k]

[0168] Elements 802, 804 have moved down by an additional macroblock andto the right by an additional macroblock. When the 3rd VOP is encoded,the encoder module 106B refers to the Refresh Map illustrated in FIG.8A[g]. If the refresh map indicates that a macroblock is be Intrarefreshed, the macroblock is encoded in Intra mode, as illustrated bythe macroblocks containing an “X” in FIG. 8A[h]. The correspondingrefresh map value for an intracoded macroblock is decreased by 1 asillustrated in FIG. 8A[i].

[0169] If the decreased value is 0, the corresponding macroblock is notregarded as a motion area. Proceeding, the processing is substantiallythe same as that for the 2nd VOP as illustrated in FIG. 8A[j]-[k], whereif the SAD for a given macroblock is larger than SAD_(th), the givenmacroblock is regarded as motion area. The refresh map is updated asillustrated in FIG. 8A[k], where the refresh map entry corresponding toa motion macroblock is set to 1.

[0170] [4] 4th VOP—FIG. 8A[1]-[p]

[0171] The processing is substantially the same as for the 3rd VOP. If acurrent macroblock has a 1 associated with it in the refresh map, it isencoded in Intra mode as illustrated by the macroblocks containing an“X” in FIG. 8A[m]. The corresponding refresh map value for an intracodedmacroblock is decreased by 1 as illustrated in FIG. 8A[n].

[0172] If the decreased value is 0, the corresponding macroblock is notregarded as a motion area. If the SAD for a given macroblock is largerthan SAD_(th), the given macroblock is regarded as motion area. Therefresh map is updated as illustrated in FIG. 8A[p].

[0173] In another embodiment, a novel enhanced AIR process is performedas follows to select which macroblocks are to be intracoded in apredicted frame. An intercede distortion value and an intracodedistortion value are calculated, as are an intercede bit rate and anintracode bit rate. Based on a comparison of the calculated intercodedistortion value and the intracode distortion value, and on a comparisonof the intercode bit rate and the intracode bit rate for eachmacroblock, a decision is made as to which macroblocks are to beintracoded. The enhanced AIR process will now be described in greaterdetail.

[0174] In order to select which prediction frame macroblock is to beintracoded, the expected distortion that would result if the macroblockwere lost or corrupted is estimated. For a predicted or intracodedmacroblock, the distortion can be reduced if the reference macroblock inthe prediction is intracoded.

[0175] With reference to FIG. 8B, recursive tracking in conjunction withthe prediction path can be used to determine the expected distortion ofthe macroblock. The dashed lines 804B to 818B, 806B to 820B, 820B to826B, 812B to 822B, 814B to 824B, 822B to 828B, and 828B to 830B,indicate motion vectors (MV) that are part of the encoded bitstream froma macroblock in the previous frame to a macroblock in the current frame.The angled solid lines, such as those from 802B to 818B, 806B to 820B,810B to 822B, 816B to 824B, 818B to 826B, 824B to 828B, and 826B to830B, indicate a zero-motion vector, where a lost motion vector is setto zero. Zero motion vectors are used by a decoder in an errorcondition, wherein the decoder, for error concealment, replaces anunrecoverable macroblock with a corresponding macroblock from a previousframe. Note that this is just one of the available error concealmentstrategies, which is termed “basic concealment.” Other concealmentstrategies, such as temporal concealment or supplemental motion vectorconcealment can be performed as well. Optionally, the effects of theseother error concealment strategies are considered separately, inparallel, when performing the recursive tracking. Referring to FIG. 8B,“p” is the packet loss probability or rate, and q=(1−p).

[0176] While encoding a given current macroblock, the encoder module106B performs a motion search on the previous frame and locates amacroblock that most closely matches the current macroblock or isotherwise determined to be a good prediction frame. This locatedmacroblock from the previous frame, depicted by a non-hatched circle,such as macroblocks 802B, 806B, 810B, 816B, 818B, 820B, 826B, is calleda prediction macroblock. After the motion search is performed, aresidual error is calculated and further encoded using the DiscreteCosine Transform (DCT), then quantized using a selected quantizationstep or quantization parameter (QP), and entropy coded using variablelength coding (VLC). The encoded bitstream consists of motion vectorinformation, entropy coded quantized DCT coefficients for the residualerror, and corresponding header information.

[0177] When the decoder receives the encoded bitstream, the decoderprocesses the coded information and reconstructs the macroblocks. Wheninformation for a macroblock is missing, which may be due to packet lossor other error conditions, the decoder preferably conceals thecorresponding macroblock using one or more error-concealment strategies,such as the basic concealment discussed above. As discussed above, whena macroblock is missing, basic concealment copies a macroblock at thesame spatial location from the previous frame. This is equivalent toreceiving a zero-motion vector and zero DCT coefficients.

[0178] In order to determine which macroblocks should be intracoded, inone embodiment the encoder system 100 includes corresponding decodercircuitry so that it can mimic the decoder process and reconstruct whatthe decoder will reconstruct both in the absence of errors, and in thepresence of one or more errors, such as a single error affecting justthe current macroblock (“MBC”). By way of example, the differencebetween the error-free reconstruction and the reconstruction assumingone error is termed “concealment error” or EC. EC is defined as follows:

EC=MBQ−MBC  Equation 16

[0179] Where MBQ is the error free reconstruction, and MBC is a singleerror reconstruction

[0180] When a given macroblock is used as a prediction macroblock forthe next frame, an error present on the given macroblock will propagateto those macroblocks in the next frame that use the given macroblock forprediction purposes, even when there is no further error in motionvectors and DCT coefficients for those next-frame macroblocks. Themechanism with which error propagates from a macroblock in a given frameto other macroblocks in the next frame is termed “the error propagationmodel.”

[0181] Error attenuation occurs when half-pixel accuracy is used forprediction either in the vertical or horizontal direction or in both thevertical and the horizontal directions. Error attenuation, comparable toa low pass filter, occurs as a result of the low-pass frequencycharacteristic of the pixel averaging operation applied when half-pixelmotion is used. Thus, given the concealment error EC calculated at theencoder system 100B, the propagated error via half-pixel motion in thehorizontal direction ECh/2, the propagated error via half-pixel motionin the vertical direction ECv/2, and the propagated error via half-pixelmotion in the horizontal and vertical direction EChv/2, can bedetermined.

[0182] Half pixel interpolation is illustrated in FIG. 8D, showinginteger pixel locations, half-pixel locations in the horizontaldirection, half-pixel locations in the vertical direction, andhalf-pixel locations in the horizontal and vertical dimension.

[0183] The half-pixel averaging filter that is normally applied to pixelvalues can be applied to the concealment error, EC, to define four typesof propagated error arrays:

[0184] ECO=EC

[0185] ECh/2=error through horizontal half-pixel motion (valuecalculated on crosses “x” in FIG. 8D)

[0186] ECv/2=error through vertical half-pixel motion (value calculatedon diamonds in FIG. 8D)

[0187] EChv/2=error through horizontal and vertical half-pixel motion(value calculated on squares in FIG. 8D)

[0188] For each of the four error arrays, the corresponding energy,which approximates the error variance under the hypothesis of zero mean,is calculated.

[0189] The four error variances for these four cases can correspondinglybe defined as:

[0190] (Equation 17)

[0191] σ_(Ec) ², σ_(Ech/2) ², σ_(Ecv/2) ² and σ_(Echv/2) ²

[0192] The following four transition or strength factors can then bedefined as: $\begin{matrix}{{\gamma_{Ec} = {{\frac{\sigma_{Ec}^{2}}{\sigma_{Ec}^{2}} - 1} = 0}},{\gamma_{h/2} = {\frac{\sigma_{Ec}^{2}}{\sigma_{h/2}^{2}} - 1}},{\gamma_{v/2} = {{\frac{\sigma_{Ec}^{2}}{\sigma_{v/2}^{2}} - {1\quad \text{and}\quad \gamma_{{hv}/2}}} = {\frac{\sigma_{Ec}^{2}}{\sigma_{{hv}/2}^{2}} - 1}}}} & \text{Equation~~18}\end{matrix}$

[0193] which correspond to the four possible cases of motion for thecurrent macroblock. These quantities are saved, together with the motionvector that is used to encode the current macroblock, (m_(x),m_(y)), theinitial error energy σ_(Ec) ² and the coding mode (Intra/Inter), in atable, file or other record.

[0194] The half-pixel horizontal and vertical propagation strength canbe approximated as follows:

γ_(hv/2)=γ_(h/2)+γ_(v/2)+γ_(h/2)+γ_(v/2)  Equation 19

[0195] using the transition factors of half-pixel horizontal andhalf-pixel vertical motion, thereby reducing the computation time andresources needed to calculate half-pixel horizontal and verticalpropagation strength or transition factor. In addition, the propagationstrengths should be positive. Therefore, a negative propagation strengthresult will be rounded or set to zero.

[0196] As illustrated in FIG. 8E, a motion vector MV can map macroblocksin the current frame Frame_(n), aligned with a grid of 16-pixel rows andcolumns, into 16×16 pixels in the predicted frame Frame_(n−1) that arenot necessarily aligned on the same grid. Indeed, as illustrated in FIG.8E, a macroblock in Frame_(n) can map to portions of up to fourmacroblocks in the predicted frame Frame_(n−1).

[0197] An error present on one or more of the four possible macroblocksfrom the previous frame used for prediction for a macroblock in thecurrent frame will be reflected in the macroblock in the current frame.The error relationship can be proportional to the overlap area. Forexample the error relationship can be proportional or based on thenumber of pixels that they overlap. Thus, for each macroblock in thecurrent frame, the up to four prediction macroblocks are identified thatwould be used when encoding the macroblock in Inter mode. Using thecorresponding motion vector information, the overlapping area isdetermined, and a weighting factor equal or related to that area is usedto normalize the overlap area to the total macroblock area, 256 (=16×16)for example, as defined by the following equation:${\sigma_{v}^{2}\left( {i,j} \right)} = {{w\left( {i,j} \right)}\quad \frac{\sigma_{u}^{2}(i)}{1 + \gamma_{i,j}}}$

[0198] that estimates the expecting distortion on macroblock j incurrent frame due to macroblock i in previous frame. Note that γ_(i,j)is one of the transition factors γ_(EC), γ_(h/2), γ_(v/2) and γ_(hv/2)defined previously, depending on the type of motion (half or integerpixel motion vector) along horizontal, vertical or both directions and${w\left( {i,j} \right)} = \frac{{w1} \cdot {h1}}{256}$

[0199] is the weighting factor relating the area of overlap (w1×h1)between macroblock j and macroblock i. The term σ_(u) ²(i) is theconcealment error σ_(EC) ² for macroblock i.

[0200] With reference to FIG. 8B, beginning with the macroblock 830B incurrent Frame_(n), there are two macroblocks in Frame_(n−1) that may beused by a decoder to recreate macroblock 830B, a macroblock 826B usedfor normal decoding, and a macroblock 828B used for concealment. Each ofthe macroblocks 826B, 828B in Frame_(n−1) may correspond to up to 4aligned macroblocks, as discussed above. The same “decode or conceal”strategy can be recursively applied for the two macroblocks 826B, 828Bin Frame_(n−1) to locate 4 macroblocks 818B, 824B, 822B, 829B in Framen−2, and then reach Frame_(n−3) with 8 macroblocks 802B, 804B, 806B,808B, 810B, 812B, 814B, 816B, and so on. Each of the 8 macroblocks inFrame_(n−3) has a probability of appearing in Frame_(n) at the currentmacroblock, if a certain series of errors/packet loss occurs duringtransmission. The probability of each one of these 8 paths is theproduct of the corresponding branch probability (p/q), where p is thepacket loss probability and q=(1−p). The probability of a particularpath to the macroblock 830B occurring can be determined by multiplyingthe p and q values along the path. Thus, there exist paths that haveprobability p², such as those where two packet losses in a row occur,and a path defined by 812B-830B with probability p³.

[0201] Assuming a relatively small probability of error (e.g. 0.1), thehigher-order (with respect top) paths, such as those with a probabilityof p² or p³ can be neglected, and FIG. 8B can thereby be simplified tothe paths illustrated in FIG. 8F. The reductions in paths in FIG. 8B isbased on an assumption that a macroblock that is to be used forconcealment is not itself corrupted, that is, the probability isneglected of multiple error/packet loss on a certain path between twomacroblocks. While this assumption may not always be true, it will mostoften be true.

[0202] Based on this simplified macroblock relationship, the expecteddistortion for the current macroblock in Frame_(n) can be estimatedusing the propagation model described above. The expected distortion isdefined using the following equation:

D(n)=pσ _(EC) ²(n)+qD′(n−1)  Equation 20

[0203] where D′(n−1) is the expected distortion for the referencemacroblocks in Frame_(n−1), as modified by the transition factors totake into account the possible half-pixel motion from Frame_(n−1) toFrame_(n). Expanding this formula for the reference macroblock inFrame_(n−1), expected distortion is defined as follows: $\begin{matrix}{{D(n)} = {{p\quad {\sigma_{EC}^{2}(n)}} + {q\left( {{p\quad \frac{\sigma_{EC}^{2}\left( {n - 1} \right)}{1 + \gamma_{({{n - 1},n})}}} + {{qD}^{''}\left( {n - 2} \right)}} \right)}}} & \text{Equation~~21}\end{matrix}$

[0204] γ_((n−1,n)) is one of the 4 transition factors (γ_(EC), γ_(h/2),γ_(v/2) and γ_(hv/2)) for the reference macroblock in Frame_(n−1),depending on the motion vector from Frame_(n−1) to Frame_(n). Assimilarly described above, D″(n−2) is the expected distortion for thereference macroblocks in Frame_(n−2) as modified by the transitionfactors to take into account the possible half-pixel motion fromFrame_(n−2) to Frame_(n−1) and from Frame_(n−1) to Frame_(n). Expandingthis term further, the expected distortion is defined as:$\begin{matrix}{{D(n)} = {{p\quad {\sigma_{EC}^{2}(n)}} + {q\left( {{p\quad \frac{\sigma_{EC}^{2}\left( {n - 1} \right)}{1 + \gamma_{({{n - 1},n})}}} + {q\left( {{p\frac{\quad {\sigma_{EC}^{2}\left( {n - 2} \right)}}{1 + \gamma_{({{n - 2},{n - 1}})} + \gamma_{({{n - 1},n})}}} + {{qD}^{\prime\prime\prime}\left( {n - 3} \right)}} \right)}} \right)}}} & \text{Equation~~22}\end{matrix}$

[0205] If Frame _(n−3) is an I-frame or if the frame buffer is limitedor restricted to 3 frame, then D′″(n−3) is equal to zero. Otherwise, thesame procedure is recursively applied to previous frame macroblocks.Similarly, if an Intra macroblock is encountered during the recursiveprocesses, it is assumed that the distortion is equal to pσ_(EC) ²,because there is no motion vector, and thus no error-propagation term.

[0206] For the above distortion equations, contributions from each oneof a maximum of 4 prediction macroblocks in each frame are summed andmultiplied by the corresponding weighting factor that relates the areaof overlap between each one of these macroblocks with the targetmacroblock in Frame_(n).

[0207] The information stored for each macroblock of previous frames canbe utilized to calculate the expected distortion for each macroblock forthe current Frame_(n). Note that this expected distortion is due toerrors in transmission and is not correlated to the distortion due toquantization for each macroblock. Therefore, the expected distortionterm needs to be added to the quantization error to determine the totaldistortion for each macroblock. This total distortion is referred to as“total Inter-mode distortion,” or D_(TINTER), as it relates to Intermode encoding of macroblocks.

[0208] For Intra mode, the expected distortion reduces to the first termas follows:

D(n)=pσ _(CE) ²(n)  Equation 23

[0209] reflecting the expected error distortion that needs to be addedto the corresponding Intra-mode quantization distortion in order to getthe “total Intra-mode distortion” for the macroblock, also referred toas D_(TINTRA).

[0210] A certain number of bits are needed for the Inter mode encodingand the Intra mode encoding, respectively referred to as R_(TINTER) andR_(TINTRA). The difference between these bit rates,ΔR=R_(INTRA)−R_(INTER), together with the difference in totaldistortion, ΔD=D_(INTRA)−D_(INTER) can be used to select the best codingmode.

[0211] If the encoder has sufficient resources and capability, a fullRate-Distortion optimization can be performed that involvesdetermination of an optimal weighting factor λ to be used for evaluatinga cost function for each macroblock, given by:

C=D+λR  Equation 24

[0212] and thus obtain the following Intra/Inter decision rule:

[0213] Choose Intra mode, when

[0214] ΔD<0, if ΔR=0

[0215] {fraction (ΔD/ΔR)}<−λ, if ΔR>0

[0216] {fraction (ΔD/ΔR)}>−λ,if ΔR<0

[0217] Else select Inter mode

[0218] Note that determination of the optimal λ parameter is optionallyachieved by trying all possible QP and λ combinations. The particularcombination that results in the least distortion among all combinationsthat produce bitstreams below or optionally equal to the desired bitrate is then selected.

[0219] Alternatively, the encoder system 100 can first choosemacroblocks that satisfy the first of the above listed cases (ΔD<0, ifΔR=0), since it is applicable to all values of λ, and also allmacroblocks that satisfy the condition {fraction (ΔF/ΔR)}≧0, if ΔR<0,which automatically applies to the third case. Then macroblocks withΔR>0 are grouped together and ordered in increasing order with respectto the ratio {fraction (ΔD/ΔR)}. Similarly, the macroblocks with ΔR<0are grouped together and ordered in decreasing order with respect to thesame ratio, {fraction (ΔD/ΔR)}.

[0220] This is shown by the graph illustrated in FIG. 8G, representingthe value of the ratio {fraction (ΔD/ΔR)} for each macroblock, where“x”s indicate those macroblock with ΔR>0 AR and “o”s indicate those withΔR<0.

[0221] The “x”s that have the most negative values, or negative valuesthat meet corresponding defined criteria, and the “o”s that have theleast negative values, or negative values that meet correspondingdefined criteria, are selected as candidates for Intra Refresh. Notethat “o”s with a positive value have already been chosen for Intracoding, and “x”s with positive value are excluded altogether as they areautomatically intracoded. Experimental results indicates thatmacroblocks with ΔR>0, indicated by an “x”, are the most common ones,because generally Intra mode costs more, as measured in bits, comparedto Inter mode. Thus, optionally only macroblocks with ΔR>0 will beconsidered for Intra refresh. The so-called refresh rate, specifying howmany additional macroblocks are to encoded in intra mode, then dictateshow many of the candidate macroblocks are eventually chosen.

[0222] A less resource intensive process is to calculate the expecteddistortion for each macroblock due to transmission error, while ignoringor excluding quantization error. Then, the differential between theexpected distortion for Intra and Inter mode can be used as thecriterion for selecting macroblocks to be Intra coded by ordering themaccording to this criterion.

[0223] Thus, Adaptive Intra Refresh (AIR) can be used to help determinehow many macroblocks should be intra-encoded in the detected motionregion of a frame. AIR can be enabled and disabled in the encoderparameter file using an AIR bit set by a user and read by the encodermodule 106B. When AIR is enabled, the user also specifies anotherparameter, the AIR refresh rate. The AIR refresh rate determines howmany macroblocks should be intra-coded in the detected motion region ofone frame. Adaptive motion change detection can efficiently reduce thelarge propagation error, even when the error occurs in the motionregion.

[0224]FIG. 8H illustrates an embodiment of the E-AIR process. At state802H, the motion vector or vectors for the current macroblock ofinterest in Frame (n) are received. At state 804H the motion vector isused to locate which macroblocks from a previous Frame (n−1) are to beused in predicating the current macroblock. At state 806H adetermination is made as to how much, in terms of area or pixels, ofeach of the located macroblocks in Frame (n−1) will be used ingenerating the current macroblock. At state 808H, the error variances(σ² _(Ec), σ² _(Ech/2), σ² _(Ecv/2), σ² _(Echv/2)) are calculated,including the overlap weighting$\left( {{w\left( {i,j} \right)}\frac{1}{1 + \gamma_{i,j}}} \right).$

[0225] At state 808H the propagation strength transition quantities arecalculated based on the error variances. At state 812H, the Intra ErrorDistortion D_(INTRA) for Frame (n) is calculated. At state 814H, theInter Error Distortion D_(INTER) for Frame (n) is recursivelycalculated. As discussed above, the recursive calculation can includethe error distortion and quantization distortion from previous frames,such as Frame (n−1), Frame (n−2), and so on, whose errors may propagateto Frame (n). The recursion may be limited to a predetermined number offrame generations, until all or a predetermined amount of the framebuffer is being used, or the recursion may stop when an Intra frame isreached.

[0226] At state 816, the value DeltaD is calculated by taking thedifference between D_(INTRA) and D_(INTER), or by otherwise comparingD_(INTRA) and D_(INTER). At state 818H the bit quantity or bit rateR_(INTRA) and R_(INTER) for intracoding Frame (n) and for intercodingFrame (n) respectively are determined. At state 820H a comparison of R,and R_(INTER) is made by calculating the difference DeltaR. At state822H the decision to intracode or to intercode is made based on DeltaR,DeltaD and Lambda using the illustrated criteria. Alternatively, thosemacroblocks having a DeltaD may be chosen for intracoding. For example,after DeltaD is calculated for all of Frame (n)'s macroblocks, the twomacroblocks having the largest DeltaD are intracoded. The macroblockintracode selection may also be based on a cost calculation where theCost=Rate+lambda*D, or D+lambda*R, and choose the highest N (=AIR rate)

[0227]FIG. 8C illustrates experimental results comparing the use ofCyclic Intra Refresh, trace 802C, with the use of the enhanced AIRmethod described immediately above, trace 804C. The overall gain isapproximately 1 dB in the PSNR. In one embodiment, the additionalcomputational load is approximately 10%.

[0228] In order to utilize AIR more effectively, conventional CyclicIntra Refresh (CIR) is combined with AIR. The number of the IntraRefresh macroblocks in a VOP is defined as the summation of theAIR_refresh_rate and the CIR_refresh_rate. AIR_refresh_rate macroblocksare encoded in AIR mode and CIR_refresh_rate macroblock are encoded inthe conventional CIR mode. These values are user definable in theencoder parameter file. When the channel degrades, higher CIR and AIRrates should preferably be assigned. In addition, when the distancebetween I-frames is large, higher CIR and AIR rates should preferably beassigned. These rates are preferably varied adaptively with changingchannel conditions as well as with the coding parameters to improve thetradeoff between error resilience and coding efficiency.

[0229] The encoder parameter file specifies many different encodingparameters, including those discussed above. The encoder parameter filecan be used in conjunction with the preprocessing module output byreading the frame-type file, which specifies the encoding type aredetermined by preprocessing process described above. By way of example,the encoder parameter file includes fields to enable/disable AIR, CIR,and SMC, to specify the AIR and CIR refresh rates, and a flag used toenable or disable the inclusion of two I-frames at the beginning of eachscene, GOV or GOP.

[0230] The encoder parameter file has the following parameters orfields: TABLE 1 Encoder parameter specification. Version Version numberand/or name Source.Width specifies frame width Source.Height specifiesframe height Source.FirstFrame specifies the first frame to be encoded(counting from 0) Source.LastFrame specifies the last frame to beencoded Source.Directory Directory to store the original source ofsequence without trailing “\” Source.SamplingRate Allows sub-samplingthe original source based on this sampling rate parameterOutput.Directory.Bitstream Output bitstream directoryOutput.Directory.DecodedFrames Directory to put the reconstructed framesfrom the encoder (encoder also performs decoding RateControl.Type [0]What type of rate control—one of “None” (maintain constant QP), “MP4”(for IMP4), “TM5” (for Test Model 5); RateControl.BitsPerVOP [0]: bitbudget for the entire sequence Quant.Type [0] One of “H263”, “MPEG”. Forlow bit rate communications, H263 is preferred. GOV.Enable [0] GOVheader present or not GOV.Period [0] Number of VOPs between GOV headersTexture.QuantStep.IVOP [0] Quantization Parameter (QP) for I-VOP; notaffected by rate control Texture.QuantStep.PVOP [0] QP for P-VOP if ratecontrol is disabled Texture.QuantStep.BVOP [0] QP for B-VOP if ratecontrol is disabled Motion.PBetweenICount [0] In case of multiplescenes, and in the presence of a frame-type file, the encoder ignoresthis parameter. Else, the length of a GOP is specified before sourcesubsampling. A negative value means one GOP for the whole sequence.Motion.ReadWriteMVs[0] One of “Off”, “Read”, “Write”Motion.ReadWriteMVs.Filename [0] Filename for Read/write MV from/tofiles ErrorResil.RVLC.Enable [0] Enable or disable RVLC—0: disable; 1:enable ErrorResil.DataPartition.Enable[0] Enable or disable datapartitioning ErrorResil.VideoPacket.Enable[0] Enable or disableintroduction of resync markers in video packet (VP)ErrorResil.VideoPacket.Length[0] If VideoPacket enables, the size of VPin bits-select based on the target bit rate ErrorResil.SMC.EnableEnable/disable second motion compensation (SMC). When =1, only 1 PVOP;when =2, for all PVOP ErrorResil.AIR.Enable Enable/disable adaptiveintra refresh (AIR) ErrorResil.CIR.Enable Enable/disable cyclic intrarefresh (CIR) ErrorResil.AIR.Rate Added for specifying the AIR rate. anAIR rate of 2, for example, may be used. ErrorResil.CIR.Rate Whenenabling CIR (see above), specifies the CIR rate (Macroblocks per VOP).A CIR rate of 2, for example, may be used. ErrorResil.2I.Enable Added toenable/disable double I-frame coding in each GOV for enhancederror-resilience

[0231] To further increase error resiliency, a Header Extension Code(HEC) is included by the encoder module 106B in every packet in asequence of video packets or in every video packet, and not just on thefirst video packet following the VOP header as with conventionalencoders. This better ensures that even if a packet is lost orcorrupted, subsequent packets can still be decoded and used. Further,even typical conventional decoders will be able to handle the inclusionof the enhanced use of HECs as the use of additional HECs is compatiblewith the MPEG-4 bitstream syntax. Adding a header, including sequenceinformation, to all packets increases overhead by only about 40 bits perpacket, or about 0.2%, but results in a noticeable improvement indecoding.

[0232] Further, Second-order Motion Compensation (SMC) is optionallyprovided to enhance error resiliency. The SMC process is performed bythe encoder module 106B and generates supplemental motion vectors sothat each predicted frame can be predicted separately from two precedingframes. Sequence 502 of FIG. 5 illustrates the SMC process, in whichk_(th) frame has motion vectors from both from the (k−1)_(th) frame andthe (k−2)_(th) frame. Therefore, even if the motion vectors from the(k−1)_(th) frame are corrupted, or the (k−1)_(th) frame is itselfcorrupted, the k_(th) frame can still be predicted from the (k−2)_(th)frame using the corresponding motion vectors. Thus, by inserting theredundant motion vectors, also termed second-order motion vectors, fromthe (k−2)_(th) frame to k_(th) frame, the scene image quality at thedecoder-side will be better protected from transmission errors. Forexample, even if all the information for k_(th) frame is corruptedduring transmission, the use of SMC can effectively suppress errorpropagation by excluding k_(th) frame from being used in any laterprediction as illustrated in FIG. 5 by sequence 504.

[0233] To perform SMC, a frame buffer is included in the encoder module106B to store the previously decoded frame at time (t−2). Thispreviously decoded frame is used to calculate the second order motionvectors. In one embodiment, these redundant motion vectors are not usedin the encoder to produce residuals. The decoder uses the second ordermotion vectors when the bitstream is corrupted during the transmissionand the first order motion vectors or corresponding frame is corrupted.Otherwise, the second order motion vectors need not be used in thedecoder. Optionally, full, unrestricted motion search can be performedin order to determine these second-order motion vectors. The informationregarding motion between frames (t−2) and (t−1) and between frames (t−1)and (t) can be combined in order to estimate these second-order motionvectors. For this reason, the SMC data can optionally be included, viathe “user data mechanism”, as explained below, for the first P-VOPfollowing a scene change or for each P-VOP. The advantage of having SMCon only the first P-VOP is that bandwidth is not wasted when there is noerror, thereby providing better coding efficiency. However, providingSMC for every P-VOP or for many P-VOPs enhances the robustness anddecoding ability of the decoder, especially for cases of severe errorconditions.

[0234] An additional video packet, referred to as “User data” or an“SMC” video packet, for each P-VOP is used to transmit thesesecond-order motion vectors. This packet contains, in the samepredictive fashion and using the same variable-length codes as in thestandard motion vectors, a motion vector for each macroblock or selectedmacroblocks of the current P-VOP. An HEC is included in this special SMCvideo packet, which allows the SMC video packet to be decoded even ifother packets for this P-VOP are lost. In one embodiment, this packet ispositioned in the bitstream at the end of each P-VOP. A user can enableor disable the use of SMC by setting to 1 or 0 the corresponding optionin the encoder parameter file. FIG. 6 illustrates an example packetizedbitstream showing the relative position of packets in the bitstream,including the SMC packet 602.

[0235] Optionally, in order to make SMC packets compliant with theMPEG-4 syntax, a so-called “User data start code” (hex code B2) or thelike, including other unique identifier codes to be assigned in thefuture by MPEG-standards committee and the like, precedes the HEC andmotion vector information. The user data start code signals standarddecoders not capable of using the second order motion vectors to ignoreall bits following it until the next start code in the bitstream, whichin this will be a VOP start code. In one embodiment, the encoderincludes a unique 16-bit identifier in order not to confuse the SMC userdata extensions with data that other people may decide to include in thebitstream following the same convention.

[0236] To further enhance error resiliency, two consecutive I-frames areinserted upon a scene change, even if the second of the two frames isnot a scene change frame and has low enough relative motion that itwould normally be interceded, as illustrated in FIG. 7. That is, thescene change frame 702 is intracoded, and the next frame 704 is thenautomatically intracoded. Thus, the loss of one I-frame will not preventthe decoder from decoding the predicted frames 706, 706, 710, 712 thatare predicted from frame 702 as well as frame 704. Frames subsequent tothe second I-frame may be encoded as intracoded frames, such as P-framesor B-frames.

[0237] The use of two consecutive I-frames advantageously prevents theprediction of a frame in the current scene using scene content fromother scenes, without degrading the performance of the SMC. Because thefirst two consecutive frames in a scene are intracoded, neither firstnor second-order motion vectors are inserted into the I-frames.

[0238] The inclusion of the consecutive I-frames can be under thecontrol of the preprocessing module 102B which can designate both ascene change frame and the next frame as intracoded frames.Alternatively, the encoder module 106B can automatically intracode aframe following a frame designated as an intracoded frame by thepreprocessing module 102B.

[0239] While the insertion of two consecutive I-frames increases thebit-budget and thus decreases coding efficiency for a certaintransmission bit-rate, in error-prone environments this inefficiency ismore then compensated for by the additional error-resilience therebyprovided. A “consecutive I-frame” flag is provided in the encoderparameter file that can be independent of the SMC flag. Advantageously,the presence of two consecutive I-frames at the beginning of each scenecan be used for the decoder to conceal transmission errors moreefficiently, even if the SMC mode is not turned on, or when it is turnedon for just the first P-VOP following the (double) I-frame after a scenechange.

[0240] Adaptive Intra Refresh (AIR) is optionally supported by theencoder module 106B as a by-product of SMC. This mode, enabled whenselecting SMC for just the first P-VOP or for every P-VOP, encodes inINTRA mode those macroblocks that have as prediction macroblocks fromframes (t−1) and (t−2) two significantly different macroblocks, asmeasured by the MAD distance measure. An example threshold is 20. Thus,if the MAD between the two prediction macroblocks for a given macroblockin the current frame is greater than 20, this macroblock is intracoded.

[0241] The encoder module 106B also performs general encoder functions,such as motion estimation, residual calculation, and the like. Theencoder output can be stored for later transmission or can betransmitted in substantially real-time to a receiving terminal, such asa cellular phone, containing an appropriate decoder.

[0242] To increase error resilience, in one embodiment Intra_dc_vlc_thris set to “0”, so that all DC coefficients are coded using DC VLC in aframe or VOP. In addition, the ac_pred_flag may be disabled for allIntra macroblocks. Both these options are permitted by the syntax and soare supported by standard decoders, and can result in higher quality forthe case of error in transmission. This improvement can be on the orderof 0.1-0.2 dB in PSNR. In particular, when data partitioning is enabled,the DC coefficient of each 8×8 DCT block of an INTRA macroblock caneither be coded together with the 63 AC DCT coefficients, using what isknown as an “INTER VLC” table, or separately, using what is known as an“INTRA VLC” table.

[0243] Using the INTRA VLC table results in separating the correspondingbits for the DC coefficient from those of the rest 63 AC coefficients asfollows:

[0244] For an I-VOP, where the macroblocks are all intracoded, the DCdata bits are located before the DC marker (DCM), together with theheader bits, while the data bits for AC coefficients are placed afterthe DC marker.

[0245] For a P-VOP, the DC data bits are placed immediately after theMotion Marker (MM), together with other crucial or importantinformation, and the data bits for AC coefficients follow.

[0246] This separation of DC and AC information enhances errorresilience, since the DC data can be decoded and trusted even forcorrupted packets, if the DCM/MM markers are correctly hitting duringthe decode process. Further, with respect to P-VOPs, Reversible VariableLength Code (RVLC) forward/backward decoding can reveal at least onegood first part.

[0247] To control whether the DC data is coded together or separate fromAC coefficients, the flag called “intra_dc_vlc_thr” is used for each VOPthat maps, according to the QP value, each macroblock. Setting thisvalue=0 means that all macroblocks, regardless of their QP should use anINTRA DC table and thus separate DC data from AC coefficients. This is astandard syntactic element in MPEG-4 and thus supported by standarddecoders.

[0248] The ac_pred_flag is another option that indicates whether for aspecific block of an INTRA macroblock, the top row and first column DCTcoefficients, are coded independently or differentially with respect tothe neighboring blocks. To enhance error resilience it is preferable toset ac_pred_flag to 0.

[0249] In one embodiment, error-correction is supported at the sourcelevel by using Forward Error Correction (FEC). In particular,Bose-Chaudhuri-Hocquenghem (BCH) codes, including Reed-Solomon, aresupported. As is well known in the art, BCH is an error detection andcorrection technique based on Cyclic Redundancy Code. For any positiveintegers m, m>3, and t<2^(m−1), there is a binary BCH code with a blocklength n equal to 2^(m)−1 and n−k<mt parity check bits, where k is thenumber of information bits. The BCH code has a minimum distance of atleast 2t+1. Each binary BCH code (n, k, t) can correct up to t biterrors, and thus it is also referred to as a t-error-correcting code.

[0250] Different block sizes may be used. In one embodiment, a blocksize of 511 is used. FEC is performed at a packetizer level of theelementary video bitstream, which can be considered as source-levelerror correction. By contrast, channel level error-correction introducesredundancy at the bit-level after multiplexing.

[0251] FEC can provide significant error resilience, at the cost of somebit budget. FIG. 11 illustrates an example graph of Forward ErrorCorrection overhead vs. average BER correction capability. Asillustrated, there is a close relation between FEC redundancy and errorcorrecting capability, which is a strong indicator of error resilience.Preferably, at least double the expected BER is provided for.

[0252] In one embodiment of the present invention, rather then apply FECto all packet data, a more efficient process is performed that reducesthe number of error correction bits generated as compared toconventional approaches, while still providing significant errorcorrecting capability. One embodiment of the FEC process optionallygenerates FEC bits only for selected portions of the packets, and inparticular, for those portions that are considered more essential orimportant for purposes of reproducing a frame sequence by the decoder.In addition, the FEC process provides a systematic code, that is, theFEC correction or parity bits are separate from the original uncodeddata bits. Thus, even if all the FEC bits are lost, the originalselected portions of the packet are still potentially decodable.Further, in one embodiment the FEC data is encoded and transmitted in anMPEG-4 compliant manner as explained below. Thus, even if a decoder thatis not equipped to process the FEC data receives the FEC packet, thedecoder will still be able to process the frame motion and texture data.

[0253] In particular, FEC is efficiently applied to important data, suchas motion vectors, DC coefficients and header information, and FEC bitsare not generated for unimportant or less important data. This moreimportant data may be located in a packet between a packet resync fieldand a motion marker. In particular, for a given frame or VOP, theselected bits targeted for FEC coding are concatenated together withthose from other frame packets and the FEC code bits are generated forthe concatenated bits.

[0254] In one embodiment, rather than including the FEC bits in the samepacket or packets as the frame data, for a given frame or VOP, theresulting FEC bits are placed in an additional packet after the regularframe or VOP packets to ensure MPEG compatibility.

[0255] In addition, to better allow the decoder to recover in cases werea data packet is lost or has a motion marker missing, for each standardpacket, in the FEC packet a packet identifier is stored in associationwith a corresponding value indicating how many bits and/or which bitswhere used to generate FEC bits.

[0256] In order to maintain compatibility with reference or conventionalMPEG-4 decoders, this additional FEC packet further includes a user dataidentifier code, “user_data_start_code,” used to identify user defineddata, and as such will be ignored by conventional decoders not equippedto process the FEC packet. In addition, where there is no error, the FECpacket will not be used by decoders equipped to handle the FEC bits. Butwhen errors do occur, FEC decoding will help recover data that willallow for decoding even under severe error conditions.

[0257] Thus, as described above, by providing error resiliency andenhanced compression, embodiments of the present inventionadvantageously enable the transmission of video information even inlow-bit rate, high noise environments. For example, embodiments of thepresent invention enable video transmission to be successfully performedover cellular networks and the like.

[0258] Although this invention has been described in terms of certainpreferred embodiments, other embodiments that are apparent to those ofordinary skill in the art are also within the scope of this invention.APPENDIX A Incorporation by Reference of Commonly Owned Applications Thefollowing patent applications, commonly owned and filed on the same dayas the present application, are hereby incorporated herein in theirentirety by reference thereto: Application Attorney Title No. Docket No.SYSTEMS AND METHODS FOR INTV.005A ENHANCED ERROR CONCEALMENT IN A VIDEODECODER SYSTEMS AND METHODS FOR INTV.006A DECODING OF PARTIALLYCORRUPTED REVERSIBLE VARIABLE LENGTH CODE (RVLC) INTRA-CODED MACROBLOCKSAND PARTIAL BLOCK DECODING OF CORRUPTED MACROBLOCKS IN A VIDEO DECODERSYSTEMS AND METHODS FOR INTV.007A DECODING OF SYSTEMATIC FORWARD ERRORCORRECTION (FEC) CODES OF SELECTED DATA IN A VIDEO BITSTREAM SYSTEMS ANDMETHODS FOR INTV.008A MANAGEMENT OF DATA IN A RING BUPFER FOR ERRORRESILIENT DECODING OF A VIDEO BITSTREAM SYSTEMS AND METHODS FORINTV.009A REDUCING ERROR PROPAGATION IN A VIDEO DATA STREAM SYSTEMS ANDMETHODS FOR INTV.010A REFRESHING MACROBLOCKS SYSTEMS AND METHODS FORINTV.011A REDUCING FRAME RATES IN A VIDEO DATA STREAM SYSTEMS ANDMETHODS FOR INTV.013A PERFORMING BIT RATE ALLOCATION FOR A VIDEO DATASTREAM SYSTEMS AND METHODS FOR INTV.014A ENCODING REDUNDANT MOTIONVECTORS IN COMPRESSED VIDEO BITSTREAMS SYSTEMS AND METHODS FOR INTV.015ADECODING REDUNDANT MOTION VECTORS IN COMPRESSED VIDEO BITSTREAMS SYSTEMSAND METHODS FOR INTV.016A DETECTING SCENE CHANGES IN A VIDEO DATA STREAM

What is claimed is:
 1. A method of providing forward error correction(FEC) on a plurality of frame packets, the method comprising:concatenating selected portions of packet data corresponding to aplurality of frame packets for a first frame; generating forward errorcorrection bits for the concatenated selected portions of packet data;and transmitting the forward error correction bits in a separate packetidentified with a user data identifier code.
 2. The method as defined inclaim 1, wherein the transmission of the forward error correction bitsin the separate packet is MPEG-4 compliant.
 3. The method as defined inclaim 1, wherein the separate packet is transmitted after the pluralityof frame packets.
 4. The method as defined in claim 1, wherein theforward error correction bits are generated using a BCH code.
 5. Themethod as defined in claim 1, wherein the forward error correction bitsare generated using a systematic code.
 6. The method as defined in claim1, wherein the selected portions of packet data includes motion vectordata and DCT data.
 7. The method as defined in claim 1, wherein theselected portions of packet data includes only header data, motionvector data and DCT data.
 8. The method as defined in claim 1, whereinthe selected portions of packet data corresponds to packet data locatedbetween a resync field and a motion marker.
 9. The method as defined inclaim 1, further comprising: setting a flag indicating that a fixedVideo Object Plane (VOP) increment is to be used; and providing acorresponding fixed time increment value.
 10. The method as defined inclaim 1, further comprising transmitting in the separate packet a valuefor at least a first of the plurality of frame packets related to aquantity of bits within the first packet for which forward errorcorrection bits were generated.
 11. An error correction generationcircuit, comprising: a first instruction stored in processor readablememory configured to generate forward error correction data for selectedportions of packet data that are to be transmitted in a correspondingplurality of frame packets; a second instruction stored in processorreadable memory configured to store the forward error correction data ina first packet separate from the plurality of frame packets; and a thirdinstruction stored in processor readable memory configured to identifythe first packet with a first data identifier code.
 12. The errorcorrection generation circuit as defined in claim 11, further comprisinga fourth instruction configured to concatenate selected portions ofpacket data before the first instruction generates the forward errorcorrection data.
 13. The error correction generation circuit as definedin claim 11, further comprising a fourth instruction configured to set aflag indicating that a fixed Video Object Plane (VOP) increment is to beused and to provide a corresponding fixed time increment value.
 14. Theerror correction generation circuit as defined in claim 11, furthercomprising a fourth instruction configured to provide a Header ExtensionCode (HEC) in a every packet in a first sequence of packets.
 15. Theerror correction generation circuit as defined in claim 11, wherein theerror correction generation circuit is an integrated circuit.
 16. Theerror correction generation circuit as defined in claim 11, wherein thefirst packet is MPEG-4 compliant.
 17. The error correction generationcircuit as defined in claim 11, wherein the forward error correctiondata is generated using a BCH code.
 18. The error correction generationcircuit as defined in claim 11, wherein the forward error correctiondata is generated using a systematic code.
 19. The error correctiongeneration circuit as defined in claim 11, wherein the selected portionsof packet data includes motion vector data and DCT data.
 20. The errorcorrection generation circuit as defined in claim 11, wherein theselected portions of packet data includes only header data, motionvector data and DCT data.
 21. The error correction generation circuit asdefined in claim 11, wherein the selected portions of packet datacorresponds to packet data located between a resync filed and a motionmarker.
 22. An encoder circuit, comprising: a means for generatingforward error correction data for selected portions of packet data froma plurality of frame packets; a means for storing the forward errorcorrection data in a first packet separate from the plurality of framepackets; and a means for identifying the first packet with a first dataidentifier code.
 23. The encoder as defined in claim 22, furthercomprising a means for concatenating the selected portions of packetdata.
 24. The encoder as defined in claim 22, further comprising a meansfor transmitting in the first packet at least a first value related to aquantity of bits within the first packet for which forward errorcorrection bits were generated.